prettier / plugin-pug

Prettier Pug Plugin
https://prettier.github.io/plugin-pug
MIT License
196 stars 44 forks source link

Enhance Variable Formatting: Convert Double Quotes to Single Quotes #512

Open Anion11 opened 1 week ago

Anion11 commented 1 week ago

Request / Idea

I would like to be able to correct double quotes to single quotes in variables (specifically in variables, not attributes)

Input

const variable = "test"

or

+mixin-name({ text: "test" })

Expected Output

const variable = 'test'

or

+mixin-name({ text: 'test' })

Maybe there is already such a function and I'm doing something wrong?

My .prettierrc:

{
  "plugins": ["@prettier/plugin-pug"],
  "printWidth": 100,
  "tabWidth": 2,
  "useTabs": false,
  "semi": false,
  "singleQuote": true,
  "quoteProps": "as-needed",
  "trailingComma": "none",
  "bracketSpacing": true,
  "bracketSameLine": false,
  "arrowParens": "avoid",
  "htmlWhitespaceSensitivity": "css",
  "singleAttributePerLine": true,
  "pugIdNotation": "as-is",
  "pugAttributeSeparator": "none",
}
Shinigami92 commented 1 week ago

Did you tried all combinations with pugSingleQuote?

Anion11 commented 1 week ago

yes, pugSingleQuote doesn't help either