-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Disable more rules covered by TypeScript in the typescript
config
#3135
Comments
What if the user is on an old version of TypeScript? |
I guess that those users will then not be on the latest version of eslint-plugin-import either, so that shouldn't be an issue. |
That’s not a reasonable assumption; many things might delay a typescript upgrade that wouldn’t affect an upgrade of an eslint plugin. |
I just tried the ancient TypeScript 1.8.10 (latest minor version of v1, released in 2016), and all of the checks were already included in that version. See my Stackblitz and run |
Then in that case it shouldn't be an issue :-) |
So move forward with the disable on those rules? What about |
It'd be fine to configure that rule to be |
I was just looking at the settings, and there doesn't seem to be a way to turn off just |
Then best to play it safe and leave that one enabled. |
Oh, wait. actually, |
That's fair, altho we should probably enable require:true in the recommended config anyways :-p |
Wouldn't that be a breaking change though? Or did you mean sometime down the road when the next major happens? |
At the next major, yeah |
The
typescript
config already disables theimport/named
rule because it does not have an advantage over errors thrown by the TypeScript compiler:eslint-plugin-import/config/typescript.js
Lines 31 to 32 in fa36d49
There are some more rules that fall in the same category, which also typescript-eslint recommends to disable:
import/namespace
import/default
import/no-named-as-default-member
import/no-unresolved
(at least forimport
statements, but not forrequire
calls)To avoid checking the same things the TypeScript compiler has already checked, I think it makes sense to also disable those rules (maybe except for
import/no-unresolved
) in thetypescript
config, so users don't have to (know and) disable them manually.(It would also mitigate #2340 for TypeScript users.)
The text was updated successfully, but these errors were encountered: