-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(eslint-plugin): [rules] Only enable rules on typescript files and include dot files #741
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
fix(eslint-plugin): [rules] Only enable rules on typescript files and include dot files #741
Conversation
fcf2670
to
5abba83
Compare
Thank you for your contribution! I don't think this is the correct way to do things. Consider the following case:
The user's disabling of the This means that instead a user has to know that the recommended config uses overrides, and use overrides themselves:
This is obviously a sub-optimal experience, especially for those that have pure TS codebases. I think that this is better fixed in user-land.
|
Thanks for the quick response! Also, I didn't see the previous discussion until after I submitted he PR. I think it is unexpected behavior that the recommended rules run on Your concern about how an end user has to override has been fixed in v6. I propose I modify this PR to use |
@bradzacher What are your thoughts about what I proposed? If this isn't wanted, no problem at all, please close as I've solved it already for myself...just wanted to help others. |
I'm not sure if it's right? cc @typescript-eslint/eslint-team |
I don't see any reason why somebody would want to disable typescript rules for js files. They might be not as useful, but they're still beneficial. |
Hey there - sorry it's been so long. As mentioned - the rules all work fine on JS code (there are only a v small list of exceptions, like None the less, thanks for the contribution! |
Typescript rules should only be enabled on typescript files. This is important for repositories with both normal JS and TS.
I ran into this problem when creating a universal eslint config for my projects. Typescript eslint rules were being enabled on normal javascript files causing a missing typescript dependency eslint error. I've manually imported them as a solution, added Typescript detection script but I think this should be fixed here.
This PR also enables overrides on
.dot
files for eslint < v6. See: eslint/eslint#11225 and eslint/eslint#11201I've been meaning to put a PR in for sometime now, but #501 (comment) motivated me to put in now because this is might be considered a breaking change.
Looks to close #109
Similar: #615