-
-
Notifications
You must be signed in to change notification settings - Fork 45
Default projectService
to false in eslint adder
#631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 5586cd2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good idea. projectService: true
is the recommendation of the typescript-eslint
team. And it's generally faster - in fact a benchmark from SvelteKit was quoted in their blog post showing that it was. If you have a case where it's slower, the typescript-eslint
team is very interested in bug reports on that topic.
I'm not sure this is related to sveltejs/eslint-plugin-svelte#1084 since it says:
This occurs with both projectService: true and project: './tsconfig.json'
We should fix sveltejs/eslint-plugin-svelte#1084 though. There was some good investigation there last month as to the potential cause and we should dig into it further
Every project I have tried this on it's slower so maybe it's worth opening an issue with typescript-eslint. There's actually a comment here https://github.com/huntabyte/shadcn-svelte/blob/main/eslint.config.js#L30 mentioning it's poor performance |
It seems like Since we're only using with that in mind, i think we have 2 options:
|
I know that in Svelte and SvelteKit we've turned on a couple of extra rules that are type-checked:
Some of the stuff that came in recommendedTypeChecked caused too many false positives in browser-based code, which is why we didn't use that. Though we also turned off tons of stuff from
|
@baseballyama What would be your preffered way here? |
I’m against setting
On the other hand, we can speed up ESLint significantly just by running it in parallel, without setting |
+1 for @benmccann's suggestion having it commented out with a short description of what it's for does seem like a nice middle ground since, in its current state, all it does is slow down the linting by a considerable amount, even when no type-aware rules are enabled in the default config that we currently apply
do you have an example project with this setup? seems like a great solution for large projects, though it might be too advanced for our simple scaffolding |
In other words, I don’t think we need to immediately set
This issue is also being discussed in the This is a separate topic, but I’m hoping that oxlint will be able to support Svelte as well. |
In every single project I maintain I make sure this is off because if it's on I have seen linting take as long as 3 minutes, quickly increasing with the size of the project I feel like there is a pretty good case for having this off by default unless it catches something extra that is really important.
There has been an open issue for this for a while in
eslint-plugin-svelte
but it has kinda stagnated: sveltejs/eslint-plugin-svelte#1084