2
votes

I use create-react-app and just want to add rules to my package.json. I see that I can disable this rule, but how? In the official document, only the phrase "If you don't want to enforce a style for using equality operators, then it's safe to disable this rule."

https://github.com/eslint/eslint/blob/master/docs/rules/eqeqeq.md#when-not-to-use-it

I found that i can write this:

// package.json
{
  "name": "mypackage",
  ...,
  "eslintConfig": {
    "rules": {
      "eqeqeq": "off"
    }
  }
}

but it not works.

I would like to clarify the question. The reason for my question here is not that I don't know how to disable the rule, I do not know how to disable it in the package.json. I just don't want to clutter up the project's root directory with an additional file.

2

2 Answers

1
votes

you can add an eslint configuration file .eslintrc and disable the rules you want inside it.

docs

0
votes

You may locate the eslint configuration file, and change eqeqeq rule to off:

eqeqeq: 'off',

Also, make sure that you don't override the setting farther.