Build keeps failing due to ESLint errors even with ESLint disabled

For some reason, I can no longer build my React project.  It seems like it is ESLint errors causing it to fail.  I have disabled ESLint under Settings -> Languages & Frameworks -> Javascript -> Code Quality Tools -> ESLint.  I'm not sure how else to stop ESLint from interfering with my build.

 

Text in the build console:

> env-cmd -f .env.test-ax-TEST-SECURE react-scripts build

Creating an optimized production build...
Failed to compile.

[eslint] 
src\assets\fontawesome-pro-6.0.0-web\js\all.min.js
  Line 13:14:      Empty block statement                                            no-empty
  Line 79:16:      Unreachable code                                                 no-unreachable

 

0
1 comment

Eslint integration in Settings -> Languages & Frameworks -> Javascript -> Code Quality Tools -> ESLint allows showing warnings and errors reported by ESLint right in the editor, but it doesn't affect the way react-scripts work, your build configuration is out of the IDE control.
To disable ESLint during building, you need using the DISABLE_ESLINT_PLUGIN environment variable (see https://create-react-app.dev/docs/advanced-configuration). For example, in .env:

DISABLE_ESLINT_PLUGIN=true

Or in your package.json:

{
  "scripts": {
    "start": "DISABLE_ESLINT_PLUGIN=true react-scripts start",
    "build": "DISABLE_ESLINT_PLUGIN=true react-scripts build",
    "test": "DISABLE_ESLINT_PLUGIN=true react-scripts test"
  }
}
0

Please sign in to leave a comment.