-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Eslint keeps requiring overridden parsers when extending config #11396
Comments
Hi, thanks for opening an issue. As I mentioned in #11240, I don't think this is a bug. ESLint does config validation at each step of the process, so it validates the contents of intermediate configs even if the contents don't appear in the final resolved config. If a shareable config references a parser that doesn't exist, that shareable config is invalid. |
I agree and disagree at the same time. I agree that it does make sense to verify each config to make clear which one produces the issue. At the same time, it does not make sense to actually require anything, especially if it will be overwritten. It is a waste of resources at least. In my opinion it should be an effort from both sides: fix the require at ESLint side and fix the improper config from CRA side. I have created an issue for create-react-app facebook/create-react-app#6129 but it is stale. |
The problem from ESLint's point of view is that we cannot know whether or not a parser will end up in the final config. A new config is calculated for every file that ESLint lints, so we need to keep each config in memory and know that each config in memory is valid so we can quickly merge them multiple times. Plus, we need to have some idea at which level the parser is being While this does seem annoying in your specific case, I think overall ESLint is doing the right thing. |
Agree. Both on validation and But. CRA is fairly popular product, so anyone who use their config is prone to the above mentioned issue, and, unfortunately, CRA turnaround is slow... So looks like for now there's no way other than to drag all of it's deps... |
@kirill-konshin yeah, I'm sorry we couldn't be of more help. This sounds like something you should work through with the CRA team, as this behavior has been in ESLint for quite some time. |
This is a follow up for autoclosed issue #11240
Can be reproduced here https://github.com/aladdin-add/eslint-issue-11240
I am using
plugin:typescript/recommended
(eslint-plugin-typescript
) on top ofreact-app
(eslint-config-react-app
) and as I can see fromeslint --print-config
theparser
field is overwritten frombabel-eslint
to correct/Users/dis/Sites/apple-music/node_modules/eslint-plugin-typescript/parser.js
, but for some reason ESLint still tries to resolve the unneeded parser, which is not even in final config.I'm kinda okay to still install the useless parser, but it is a bit annoying.
Tell us about your environment
Please show your full configuration:
Configuration
What actually happened? Please include the actual, raw output from ESLint.
The text was updated successfully, but these errors were encountered: