0

When I save I the quotes are changing from backticks -> ´ <- (this one the other way around) to ".

From:

module.exports = {
  siteMetadata: {
    title: `Gatsby Default Starter`,
    description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
    author: `@gatsbyjs`,
  },

to

module.exports = {
  siteMetadata: {
    title: "Gatsby Default Starter",
    description:
      "Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.",
    author: "@gatsbyjs",
  },

How can I prevent that?

I use prettier and eslint with defaults

Jan
  • 12,992
  • 9
  • 53
  • 89
  • `"prettier.singleQuote": true` -> https://stackoverflow.com/a/48866406/2312051 – Denis Tsoi May 09 '20 at 09:08
  • not working: its overwriting the backticks to singlequotes – Jan May 09 '20 at 09:15
  • hmm... I disabled now prettier nothing changed, then I disabled eslint. after disabling eslint, the error did not appear. so it has to do with eslint – Jan May 09 '20 at 09:26
  • suppose you could use `"prettier.singleQuote": false` – Denis Tsoi May 09 '20 at 09:26
  • you could also use `"prettier.quoteProps": "as-needed"` – Denis Tsoi May 09 '20 at 09:29
  • my current prettier options: `{ "arrowParens": "always", "bracketSpacing": true, "endOfLine": "lf", "htmlWhitespaceSensitivity": "css", "insertPragma": false, "jsxBracketSameLine": false, "jsxSingleQuote": false, "printWidth": 80, "proseWrap": "preserve", "quoteProps": "as-needed", "requirePragma": false, "semi": true, "singleQuote": false, "tabWidth": 2, "trailingComma": "es5", "useTabs": false, "vueIndentScriptAndStyle": false, "parser": "babel" }` – Denis Tsoi May 09 '20 at 09:30
  • ESLint is the troublemaker – Jan May 09 '20 at 09:32
  • For now I set `"eslint.enable": false,` to prevent `.js` files to ne bot formatted by ESLint, but this is not a valid solution – Jan May 09 '20 at 09:38
  • `"eslint.quotes" = ["error", "double", { "allowTemplateLiterals": true }]` – Denis Tsoi May 09 '20 at 11:14

0 Answers0