Skip to content

Instantly share code, notes, and snippets.

@kyh196201
Last active December 9, 2023 04:56
Show Gist options
  • Save kyh196201/1130aa08e7eca0df69ade83ee664b2e2 to your computer and use it in GitHub Desktop.
Save kyh196201/1130aa08e7eca0df69ade83ee664b2e2 to your computer and use it in GitHub Desktop.
prettier config for vue3
// ref: https://gist.github.com/karpolan/2c573b5767bc9b65db9936c7fad4daac
module.exports = {
endOfLine: "auto",
printWidth: 120, // max 120 chars in line, code is easy to read
useTabs: false, // use spaces instead of tabs
tabWidth: 2, // "visual width" of of the "tab"
/* trailingComma: "all", */
trailingComma: 'es5', // add trailing commas in objects, arrays, etc.
semi: true, // add ; when needed
singleQuote: true, // '' for stings instead of ""
bracketSpacing: true, // import { some } ... instead of import {some} ...
arrowParens: 'always', // braces even for single param in arrow functions (a) => { }
jsxSingleQuote: false, // "" for react props, like in html
bracketSameLine: false, // pretty JSX
vueIndentScriptAndStyle: true,
singleAttributePerLine: true, // print only one attribute per line in Vue SFC templates, HTML, and JSX
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment