prettier.config.js 836 B

12345678910111213141516171819202122232425262728293031
  1. module.exports = {
  2. // 一行最多 180 字符
  3. printWidth: 120,
  4. // 使用 2 个tab缩进
  5. tabWidth: 2,
  6. // 使用tab符缩进,false为空格缩进
  7. useTabs: true,
  8. // 行尾需要分号
  9. semi: false,
  10. // 使用单引号
  11. singleQuote: true,
  12. // 对象的 key 仅在必要时用引号
  13. quoteProps: 'as-needed',
  14. // jsx 不使用单引号,而使用双引号
  15. jsxSingleQuote: false,
  16. // 末尾不需要逗号
  17. trailingComma: 'none',
  18. // 大括号内的首尾需要空格
  19. bracketSpacing: true,
  20. // jsx 标签的反尖括号不需要换行
  21. jsxBracketSameLine: true,
  22. // 箭头函数,只有一个参数的时候,也需要括号
  23. arrowParens: 'always',
  24. // 根据显示样式决定 html 要不要折行
  25. htmlWhitespaceSensitivity: 'css',
  26. // 换行符使用 lf
  27. endOfLine: 'lf',
  28. // 缩进js跟css
  29. vueIndentScriptAndStyle: true
  30. }