-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy path.prettierrc.js
40 lines (40 loc) · 1.19 KB
/
.prettierrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
module.exports = {
printWidth: 120,
trailingComma: 'all',
singleQuote: true,
arrowParens: 'avoid',
jsxSingleQuote: false,
semi: true,
jsxBracketSameLine: false,
plugins: ['@trivago/prettier-plugin-sort-imports'],
importOrder: [
// react相关,支持子模块导入
'^(react|react-dom|react-router-dom)(\/.+)?$',
// redux相关,支持子模块导入
'^(redux|react-redux|redux-thunk)(\/.+)?$',
// react-库
'^(@?react-).+',
// 第三方组件库,支持子模块导入
'^(antd|antd-mobile|@ant-design)(\/.+)?$',
// 剩余第三方库
'<THIRD_PARTY_MODULES>',
// ming-ui组件库,支持子模块导入
'^(ming-ui)(\/.+)?$',
// API
'.*/api/.*',
// 指定业务模块
'^(worksheet|mobile|statistics)',
// 业务模块
'^src/',
// 父级导入,排除样式文件
'^(\.\.\/)+(?!.*\.(?:css|less)$).*$',
// 同级导入,排除样式文件
'^\./(?!.*\.(?:css|less)$).*$',
// 样式文件
'^.+\.(?:css|less)$',
],
// importOrderSeparation: true,
importOrderSortSpecifiers: true,
importOrderCaseInsensitive: true,
importOrderParserPlugins: ['classProperties', 'decorators-legacy', 'jsx'],
};