You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When applying custom ESLint configuration where you define a rule as error globally but off for a filename pattern, npm run build does not correctly ignore those filename patterns for the rule in question. Running ESLint directly works as expected, disabling the rule for that filename pattern.
Note that I have set up EXTEND_ESLINT=true in my .env and added "react-app" to extends in my .eslintrc.js
Did you try recovering your dependencies?
Yes - I even created a fresh create-react-app to repro this.
Which terms did you search for in User Guide?
Extend ESLint, ESLint
Environment
System:
OS: macOS 10.15.2
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Binaries:
Node: 12.14.0 - ~/.nvm/versions/node/v12.14.0/bin/node
Yarn: Not Found
npm: 6.13.4 - ~/.nvm/versions/node/v12.14.0/bin/npm
Browsers:
Chrome: 79.0.3945.88
Firefox: 34.0.5
Safari: 13.0.4
npmPackages:
react: ^16.12.0 => 16.12.0
react-dom: ^16.12.0 => 16.12.0
react-scripts: 3.3.0 => 3.3.0
npmGlobalPackages:
create-react-app: Not Found
I have also reproduced the same issue on my Windows 10 PC at work, but do not have access to that command output at the moment.
Add a package.json script for linting: "lint": "eslint src"
npm run lint. Observe that there are no lint errors detected
npm run build.
Expected behavior
The build would succeed
Actual behavior
The build failed with the following error
Creating an optimized production build...
Failed to compile.
./src/App.js
Line 6:21: Expected to return a value at the end of arrow function consistent-return
Search for the keywords to learn more about each error.
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.
Describe the bug
When applying custom ESLint configuration where you define a rule as
error
globally butoff
for a filename pattern,npm run build
does not correctly ignore those filename patterns for the rule in question. Running ESLint directly works as expected, disabling the rule for that filename pattern.Note that I have set up
EXTEND_ESLINT=true
in my .env and added"react-app"
toextends
in my .eslintrc.js
Did you try recovering your dependencies?
Yes - I even created a fresh create-react-app to repro this.
Which terms did you search for in User Guide?
Extend ESLint, ESLint
Environment
I have also reproduced the same issue on my Windows 10 PC at work, but do not have access to that command output at the moment.
Steps to reproduce
npm install [email protected]
Create an
.eslintrc.js
with the following:App.js
somewhereAdd a package.json script for linting:
"lint": "eslint src"
npm run lint
. Observe that there are no lint errors detectednpm run build
.Expected behavior
The build would succeed
Actual behavior
The build failed with the following error
Reproducible demo
https://github.com/cheezekurl/cra-eslint-bug-repro
The text was updated successfully, but these errors were encountered: