-
-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Description
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:
- this ain't quite true - because used
eslintCli.getConfigForFileis not limited to package.json configs - there is no such mention in the docs - not a biggie but brought a little bit of confusion for me.
What 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 (with paths.appIndexJs as argument) gets set as "global" config for the whole eslint-loader.
So depending on what paths.appIndexJs is we either can get:
- all TS-related rules being applied to ALL files (including JS) - when
paths.appIndexJsis TS - no TS rules are applied at all - when
paths.appIndexJsis JS
For 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.
shadel, giuband, probablyadev, ae2438, rogerclotet and 8 more