Disable ESLint that create-react-app provides

Ginpei picture Ginpei · Apr 24, 2019 · Viewed 17.6k times · Source

create-react-app v3.0.0 is out. It supports TypeScript linting internally. (That's nice!) I think I understand the situation where TSLint is on, and am planning to replace it with ESLint, but it is not right now.

How to disable that linting step in react-scripts start?

/* eslint-disable */ and others are not the ones I'm looking for.

UPDATE: According to the following discussion, it looks there are no ways to manipulate internal ESLint. Thus, the answer to my question would be "you cannot".

https://github.com/facebook/create-react-app/issues/808

Answer

kodemi picture kodemi · Dec 9, 2019

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