.prettierrc.yaml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # 一行最多多少个字符
  2. printWidth: 120
  3. # 指定每个缩进级别的空格数
  4. tabWidth: 2
  5. # 使用制表符而不是空格缩进行
  6. useTabs: true
  7. # 在语句末尾打印分号
  8. semi: false
  9. # 使用单引号而不是双引号
  10. singleQuote: true
  11. # 控制对象属性名是否使用引号 可选值<as-needed|consistent|preserve>
  12. quoteProps: 'as-needed'
  13. # 在JSX中使用单引号而不是双引号
  14. jsxSingleQuote: false
  15. # 多行时是否在末行添加逗号 可选值<none|es5|all>,默认none
  16. trailingComma: 'es5'
  17. # 在对象文字中的括号之间打印空格
  18. bracketSpacing: true
  19. # jsx 标签的反尖括号需要换行
  20. jsxBracketSameLine: false
  21. # HTML 标签的闭合括号是否与标签名在同一行
  22. bracketSameLine: true
  23. # 在单独的箭头函数参数周围包括括号 always:(x) => x \ avoid:x => x
  24. arrowParens: 'always'
  25. # 仅格式化需要 pragma 的文件 @prettier
  26. requirePragma: false
  27. # 在已格式化的文件开头插入 @prettier
  28. insertPragma: false
  29. # 使用默认的折行标准 always\never\preserve
  30. proseWrap: 'preserve'
  31. # 指定HTML文件的全局空格敏感度 css\strict\ignore
  32. htmlWhitespaceSensitivity: 'css'
  33. # Vue文件脚本和样式标签缩进
  34. vueIndentScriptAndStyle: false
  35. # 换行符使用 lf 结尾是 可选值<auto|lf|crlf|cr>
  36. endOfLine: 'lf'
  37. # 是否将每个属性放在单独一行
  38. singleAttributePerLine: false