Skip to content

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

Open
@Anion11

Description

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",
}

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedWe are looking for community helptype: enhancementFunctionality that enhances existing features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions