3

As title says, when I format HTML files using prettier all my single quotes change to double quotes, but it works well in JavaScript or TypeScript files keeping the single quotes.

I managed to set emmet abbreviation to put single quotes in HTML but when I format they go back to doubles.

Any help will be appreciated!!

My settings.json looks like this:

  "workbench.colorTheme": "Andromeda",
  "editor.fontFamily": "'Cascadia Code', Consolas, 'Courier New', monospace",
  "editor.fontLigatures": true,
  "editor.fontWeight": "bold",
  "javascript.preferences.quoteStyle": "single",
  "typescript.preferences.quoteStyle": "single",
  "html.completion.attributeDefaultValue": "singlequotes",
  "emmet.syntaxProfiles": {
    "svelte": "html",
    "typescript": "html",
    "javascriptreact": "html",
    "typescriptreact": "html",
    "html": {
      "attr_quotes": "single",
      "self_closing_tag": true
    }
  },
  "emmet.includeLanguages": {
    //"svelte": "html",
    "typescript": "html",
    "javascriptreact": "html",
    "typescriptreact": "html"
    //"javascript": "javascriptreact"
  },
  "emmet.triggerExpansionOnTab": true,
  "[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "prettier.bracketSpacing": false,
  "prettier.jsxSingleQuote": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode",

  "prettier.useEditorConfig": false,
  "prettier.singleQuote": true,
  "editor.formatOnSave": true
}```
gonkeykong
  • 31
  • 2
  • This might help: https://stackoverflow.com/questions/55430906/prettier-single-quote-for-javascript-and-json-double-quote-for-html-sass-and-c – swamp Jan 30 '22 at 12:24

1 Answers1

-1

disable ESLint rule works for me. But i doubt it

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 31 '22 at 09:41