Disable ESLint that create-react-app provides Disable ESLint that create-react-app provides typescript typescript

Disable ESLint that create-react-app provides


You could set EXTEND_ESLINT environment variable to true, for example in .env file:

EXTEND_ESLINT=true

Now you can extend eslint configuration in your package.json file:

..."eslintConfig": {    "extends": "react-app",    "rules": {      "jsx-a11y/anchor-is-valid": "off"    }  },...

To disable eslint you could add a file .eslintignore with the content:

*

See documentation for details: https://create-react-app.dev/docs/setting-up-your-editor/#experimental-extending-the-eslint-config


As of react-scripts v4.0.2, you can now opt out of ESLint with an environment variable. You can do this by adding it to your .env file, or by prefixing your scripts in your package.json file.

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"  }}

https://github.com/facebook/create-react-app/pull/10170


You can disable (and override other configurations) using Craco.

It takes 4 changes:

  1. npm install @craco/craco --save
  2. create craco.config.js (in the same folder as is package.json)
  3. populate craco.config.js with:
module.exports = {  eslint: {    enable: false,  },};

Finally, replace react-script with craco in your package.json scripts, i.e.

"scripts": {  "build": "craco build",  "start": "craco start",}

This will disable ESLint. Refer to Craco documentation for examples how to extend ESLint configuration.