Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable eqeqeq for create-react-app --typescript

I have tried several things, but I can't find way how to disable eqeqeq for my project.

My project is created via create-react-app --typescript

Here are screenshots https://imgur.com/RqC2D4i https://imgur.com/aKjJiyz

I have tried several plugins for eslint or tslint

I have tried several config files:

.eslintrc
.eslint.config
.eslint.json
.tslintrc
.tslint.config
.tslint.json

or even in package.json

"eslintConfig": {
  "extends": "react-app"
  "rules": {
    "eqeqeq": "off"
  }
},

Rules in files rc, .json or .config I have tried with several combinations

{
  "rules": {
    "eqeqeq": "off" // never, 0, 2
  }
}
like image 212
Keri Marr Avatar asked Aug 11 '19 16:08

Keri Marr


People also ask

How do I turn off the lint rule in react?

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.

How do I disable ESLint in react native?

How do I remove ESLint from react native? Use /* eslint-disable */ to ignore all warnings in a file.

What react scripts start does?

start. React uses Node. js on development to open the app on http://localhost:3000 , thus the start script enables you to start the webpack development server.


1 Answers

Create-react-app disables external eslint config by default. To extend default eslint config, set a environment variable like this.

EXTEND_ESLINT=true

And then you can use any of the eslint config setting like package.jsonor .eslintrc.js etc.

For more information https://create-react-app.dev/docs/setting-up-your-editor/#experimental-extending-the-eslint-config

This is experimental feature as of react-scripts 3.3.0 but it at least it should work with this.

like image 169
think-serious Avatar answered Nov 15 '22 08:11

think-serious