In a lerna monorepo since ESLint 7.0.0 extending the eslint-config-create-app seems to not work.
In my ./packages/myreactpackage/.eslintrc.js i have:
module.exports = {
root: true,
extends: ['react-app'],
};
Is there something to be changed here or in eslint itself, it seems the new plugin-loading-mechanism is kicking in?
yarn lint
yarn run v1.22.4
$ eslint . --ext .html,.js,.jsx,.ts,.tsx --fix && lerna run lint:stylesOops! Something went wrong! :(
ESLint: 7.0.0
ESLint couldn't find the config "react-app" to extend from. Please check that the name of the config is correct.
The config "react-app" was referenced from the config file in "[redacted]\packages\myreactpackage\.eslintrc.js".
If you still have problems, please stop by https://gitter.im/eslint/eslint to chat with the team.
Looks like the problem is location of the eslint-config-react-app
, currently it lays inside node_modules\react-scripts\node_modules
while Eslint's v7 seems to only look at plugins that are on the first level of node_modules directory. Hope this helps https://github.com/eslint/eslint/issues/13283.
Seems like yarn dedupe mechanism kicks in https://github.com/eslint/eslint/issues/13283.
Maybe it is necessary to document setting up eslint-config-react-app and its peer dependencies to get the possibility to extend this config?
Kind of unrelated, but I think eslint-config-react-app
should just list all its dependencies as actual dependencies
, not peerDependencies
. That way one can depend on it directly without having to list all the peer deps as well. package managers will dedupe dependencies correctly in either case.
It would be nice to have a small guide on how to integrate the new ESLint version with TypeScript, Prettier and VS Code.
Related to this proposal:
https://github.com/facebook/create-react-app/issues/8849 _Recommended way of config integration with ESLint, TypeScript, Prettier and VS Code_
Why was this closed?
I get that version was pinned for now but is there a track of work to update it?
Same question here, it's already 7.6.0
and react-scripts
is still stuck on the 6.6.0
:(
I'll answer myself, it's on the way, with 4.0 release:
https://github.com/facebook/create-react-app/milestone/69
Edit: when 4.0 will be ready, ESLint will probably be on version 8.
Well, got the same issue with create-react-app
4.0. And ESLint is on version 7 still.
Most helpful comment
Same question here, it's already
7.6.0
andreact-scripts
is still stuck on the6.6.0
:(