I have a monorepo that is managed by Lerna and yarn workspaces.
All eslint and prettier configs are hosted in the root of the monorepo, CRA v4 ignores the .eslintignore and .prettierignre
and lints files and folders that are skipped in .eslintignore and .prettierignre.
running eslint via the command line or vs code load the .eslintignore and .prettierignre and respects the ignored files,
back in CRA v3 this was working.
Environment Info:
current version of create-react-app: 4.0.0
running from C:\Users\user\AppData\Local\Yarn\Data\global\node_modules\create-react-app
System:
OS: Windows 10 10.0.19041
CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
Binaries:
Node: 14.13.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 86.0.4240.111
Edge: Spartan (44.19041.423.0), Chromium (86.0.622.58)
Internet Explorer: 11.0.19041.1
npmPackages:
react: Not Found
react-dom: ^17.0.1 => 17.0.1
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found
If the ignored file contains eslint or prettier error CRA shouldn't report it in the terminal
CRA lists the files that supposed to be ignored when running dev or build scripts and displays the errors in the terminal
https://github.com/ahrbil/cra-v4-monorepo-eslint
@cra-v4-monorepo-eslint/web: Starting the development server...
@cra-v4-monorepo-eslint/web: Failed to compile.
@cra-v4-monorepo-eslint/web: src\ignore-this-file.tsx
@cra-v4-monorepo-eslint/web: Line 7:42: 'children' is missing in props validation react/prop-types
@cra-v4-monorepo-eslint/web: Line 7:52: 'color' is missing in props validation react/prop-types
@cra-v4-monorepo-eslint/web: Line 8:10: Delete `路` prettier/prettier
@cra-v4-monorepo-eslint/web: Search for the keywords to learn more about each error.
even if the ignore-this-file.tsx file is ignored in the .eslintignore file, it is still being checked and makes the build fails to compile
Good catch, if this is true, it explains all the performance issues people have been having since v4 came out.
Hello @mareksuscak
I made a repo that you can check:
https://github.com/ahrbil/cra-v4-monorepo-eslint
We are having a similar issue. With v4, it seems like the use of eslint-webpack-plugin is not respecting .eslintignore or the ignorePatterns option in package.json. We use yarn workspaces. The symptom we face is that eslint tries to extend configs in the root node_modules folder of the monorepo where it should not. Have any ideas for resolving this?
Most helpful comment
Good catch, if this is true, it explains all the performance issues people have been having since v4 came out.