-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Extending ESLint is not supporting overrides #7776
Comments
i have same issue |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This also leads to other problems, such as the same parser being used for JS and TS files. This leads to parsing errors in mixed code bases which is an annoying problem because syntactically correct code can't be run due to a non essential tool (ESLint) which can't even be turned off. |
Hi @Andarist. Sorry this fell through the cracks. Let me try to address your comments:
Agreed. This should be clarified in the docs.
Yeah this should be explicitly stated in the language above that example.
Can you confirm this? I seem to remember when testing this that Thanks for bringing this up. We'd gladly accept PRs to improve the documentation for points you raised. |
Hi all, sorry for inconvenience. This was something I briefly tested during development, but admittedly it needed more work. I'm not sure how to best go about this, I have an idea... but have reached out to the ESLint team for advice. |
@Andarist, sorry I think we were confused about what you were reporting. I've managed to reproduce now and understand. Sorry for the inconvenience. So, in short:
How do these changes sound to everyone? I've tested them by modifying the Webpack config (in |
@mrmckeb Thanks for taking a look at this! I believe that would help to fix my case because it would simply offload config loading to ESLint and everything would be loaded on per-file basis 👍 |
@mrmckeb I was also struggling for days with this issue. Yes, that solves the problem. |
@mrmckeb But when I applied your changes and set |
Thank you @mrmckeb for a fix! I'm afraid I won't be able to test this out within the next 2 weeks as I'm on parental leave right now. |
Extending ESLint got introduced originally in #7036 by @mrmckeb. It's stated that this is limited currently to users configuring their ESLint in package.json:
eslintCli.getConfigForFile
is not limited to package.json configsWhat is actually stated in the docs and what doesn't actually hold true is that
overrides
can be used to support TS rules etc (there is example of that).This is not quite true, because whatever config gets loaded & resolved through that
eslintCli.getConfigForFile
call (withpaths.appIndexJs
as argument) gets set as "global" config for the whole eslint-loader.So depending on what
paths.appIndexJs
is we either can get:paths.appIndexJs
is TSpaths.appIndexJs
is JSFor this to work correctly it would be the easiest to allow ESLint to load configs on its own - without passing explicit single config to the eslint-loader.
The text was updated successfully, but these errors were encountered: