prettier.config.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. module.exports = {
  2. //指定每行长度
  3. printWidth: 150,
  4. //指定缩进的空格数
  5. tabWidth: 2,
  6. //用tab代替空格
  7. useTabs: false,
  8. //行尾自动加分号
  9. semi: true,
  10. //对Vue文件中<script>和<style>标签内的代码进行缩进
  11. vueIndentScriptAndStyle: true,
  12. singleQuote: true,
  13. //对象里的key是否引号包裹 1.as-needed 2.consistent 3.preserve
  14. quoteProps: 'as-needed',
  15. //对象字面增加空格
  16. bracketSpacing: true,
  17. //多行情况下,在末尾增加逗号
  18. trailingComma: 'es5',
  19. //jsx 单引号代替双引号
  20. jsxSingleQuote: false,
  21. //箭头函数单参数是否用括号
  22. arrowParens: 'always',
  23. //插入特殊符号
  24. insertPragma: false,
  25. //注释代码格式化
  26. requirePragma: false,
  27. //是否折叠行
  28. proseWrap: 'never',
  29. //html対空格敏感度
  30. htmlWhitespaceSensitivity: 'strict',
  31. //结尾自动换行
  32. endOfLine: 'auto',
  33. //是否格式化某一部分
  34. rangeStart: 0,
  35. //使用单引号
  36. "singleQuote": true,
  37. };