prettier.config.cjs 889 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * Prettier 配置文件
  3. * 用于定义代码格式化的规则
  4. */
  5. module.exports = {
  6. /**
  7. * 换行宽度,当代码宽度达到多少时换行
  8. * @type {number}
  9. */
  10. printWidth: 120,
  11. /**
  12. * 是否在语句末尾添加分号
  13. * @type {boolean}
  14. */
  15. semi: true,
  16. /**
  17. * 是否在 Vue 文件中缩进 script 和 style 标签
  18. * @type {boolean}
  19. */
  20. vueIndentScriptAndStyle: true,
  21. /**
  22. * 是否使用单引号
  23. * @type {boolean}
  24. */
  25. singleQuote: true,
  26. /**
  27. * 是否在多行对象、数组等的末尾添加逗号
  28. * @type {string}
  29. */
  30. trailingComma: 'all',
  31. /**
  32. * 是否在 Markdown 文件中换行
  33. * @type {string}
  34. */
  35. proseWrap: 'never',
  36. /**
  37. * HTML 空白字符敏感度
  38. * @type {string}
  39. */
  40. htmlWhitespaceSensitivity: 'strict',
  41. /**
  42. * 行尾结束符
  43. * @type {string}
  44. */
  45. endOfLine: 'auto',
  46. };