.prettierrc.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. module.exports = {
  2. // max 100 characters per line
  3. printWidth: 100,
  4. // use 4 spaces for indentation
  5. tabWidth: 4,
  6. // use spaces instead of indentations
  7. useTabs: false,
  8. // semicolon at the end of the line
  9. semi: true,
  10. // use single quotes
  11. singleQuote: true,
  12. // object's key is quoted only when necessary
  13. quoteProps: 'as-needed',
  14. // use double quotes instead of single quotes in jsx
  15. jsxSingleQuote: false,
  16. // no comma at the end
  17. trailingComma: 'none',
  18. // spaces are required at the beginning and end of the braces
  19. bracketSpacing: true,
  20. // end tag of jsx need to wrap
  21. jsxBracketSameLine: false,
  22. // brackets are required for arrow function parameter, even when there is only one parameter
  23. arrowParens: 'always',
  24. // format the entire contents of the file
  25. rangeStart: 0,
  26. rangeEnd: Infinity,
  27. // no need to write the beginning @prettier of the file
  28. requirePragma: false,
  29. // No need to automatically insert @prettier at the beginning of the file
  30. insertPragma: false,
  31. // use default break criteria
  32. proseWrap: 'preserve',
  33. // decide whether to break the html according to the display style
  34. htmlWhitespaceSensitivity: 'css',
  35. // lf for newline
  36. endOfLine: 'lf'
  37. };