create-vue
create-vue copied to clipboard
Whether eslint and prettier add a single quote support
Single and double quotes are supported in the JS/ES spec. This doesn't have anything to do with Vue, Create Vue, Vite, ESLint, or Prettier.
It's prettiers default config to prefer double quotes. It can be configured but this project doesn't do that ATM.
Please refer to https://github.com/vuejs/core/blob/main/.prettierrc#L2 https://github.com/vuejs/create-vue/blob/main/.prettierrc#L4
prettier options https://prettier.io/docs/en/options.html prettier Configuration File https://prettier.io/docs/en/configuration.html
my config .prettierrc.yaml
semi: false
singleQuote: true
endOfLine: auto
We might want to include this in the template should the generated code keep following this style, to avoid formatting errors. Although it is kind of opinionated.
Please refer to https://github.com/vuejs/core/blob/main/.prettierrc#L2 https://github.com/vuejs/create-vue/blob/main/.prettierrc#L4
prettier options https://prettier.io/docs/en/options.html prettier Configuration File https://prettier.io/docs/en/configuration.html
my config
.prettierrc.yaml
semi: false singleQuote: true endOfLine: auto
This can be solved by adding a Prettier configuration file to the root of the Vue project, which you want to include when you create a Vue project and select Prettier
.prettierrc
{
"singleQuote": true,
"semi": false,
"trailingComma": "none"
}