Skip to main content

prettier

prettier.config.js

// https://prettier.io/docs/en/options.htmlmodule.exports = {  printWidth: 120,  singleQuote: true,  trailingComma: 'all',};

排序 import#

npm add @trivago/prettier-plugin-sort-imports
module.exports = {  printWidth: 80,  tabWidth: 4,  trailingComma: 'all',  singleQuote: true,  jsxBracketSameLine: true,  semi: true,  // @trivago/prettier-plugin-sort-imports  importOrder: ['^@core/(.*)$', '^@server/(.*)$', '^@ui/(.*)$', '^[./]'],  importOrderSeparation: true,};