Disable quote rule in Eslint config file

Viewed 5954

I could only find rules to show errors for a double quote, single quote, or backticks. Couldn't find a rule to fully disable this quote error. I don't want to see an error no matter what quote is being used in a project.

3 Answers

There are two options. You can add these rules inside eslintrc.json

"avoidEscape": true allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise

"allowTemplateLiterals": true allows strings to use backticks

the reference here: https://eslint.org/docs/rules/quotes

Hi You can use this rule in the .eslintrc.json file

{
...
   "rules": {
      ...
      "avoidEscape": true,
      "allowTemplateLiterals": true
   }
...
}

To completely disable the quotes rule, set it to either 0 or off in your eslint configuration file (see the different configuration formats here).
Example for disabling in json configuration file:

{
  "rules": {
    "quotes": "off",
     ...
  }
}

More on disabling rules can be found here.

Related