25

When I configure my vscode with eslint & prettier, I met a problem in .settings.json file with error message "Auto Fix is enabled by default. Use the single string form.": enter image description here

My eslint configuration is:

enter image description here

My prettier configuration is:

module.exports = {
  singleQuote: true,
  semi: false
}

Does anybody know what's the reason and how to fix?

LegendOfFire
  • 261
  • 1
  • 3
  • 4
  • Fixing the indentation might help? – Teemu Apr 20 '20 at 06:28
  • 1
    Sorry I forgot to add the error message, it says: "Auto Fix is enabled by default. Use the single string form." And I also tried the tabWidth:4, but it doesn't work for .settings.json file. – LegendOfFire Apr 20 '20 at 07:06

1 Answers1

63

It seems a tab width issue, try add "tabWidth": 4 in your prettier config.

EDIT:

According to ESLint Reference: "eslint.validate" is an array of language identifiers specifying the files for which validation is to be enforced.

"eslint.validate" accept an array of language identifiers, not an array of objects.

No need for "autoFix", it defaults to be true.

So your settings should be:

"eslint.validate": [
    "vue",
    "html",
    "javascript"
]
Yan
  • 854
  • 1
  • 8
  • 15
  • 1
    Sorry I forgot to add the error message, it says: "Auto Fix is enabled by default. Use the single string form." And I also tried the tabWidth:4, but it doesn't work for .settings.json file. – LegendOfFire Apr 20 '20 at 07:06
  • 4
    This answer is correct. You should mention `"eslint.validate": ["vue", "html", "javascript"]` instead of array of objects. – Noopur Phalak Jan 21 '21 at 14:20