@cgzair/prettier-config-cgz 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +23 -1
  2. package/package.json +4 -2
package/index.js CHANGED
@@ -5,7 +5,7 @@ module.exports = {
5
5
  trailingComma: "all",
6
6
  printWidth: 120,
7
7
  proseWrap: "never",
8
- attributeGroups: ["$CODE_GUIDE"],
8
+ attributeGroups: ["$CODE_GUIDE", "@trivago/prettier-plugin-sort-imports"],
9
9
  plugins: [styleOrder],
10
10
  // plugins: [organizeAttributes, styleOrder],
11
11
  overrides: [
@@ -16,4 +16,26 @@ module.exports = {
16
16
  },
17
17
  },
18
18
  ],
19
+ importOrder: [
20
+ "<BUILTIN_MODULES>",
21
+ // 1. react、vue 等框架
22
+ "^(react|react-dom|vue)$",
23
+ // 2. 框架配套(redux、router 等)
24
+ "^(redux|react-redux|@reduxjs/toolkit|vuex|vue-router|react-router|react-router-dom|dva)$",
25
+ // 3. UI 库(antd、element-ui)
26
+ "^(antd|@ant-design|element-ui)$",
27
+ // 4. 其他 external
28
+ "<THIRD_PARTY_MODULES>",
29
+ // 5. @/ @c/ 本地别名
30
+ "^@/",
31
+ "^@c/",
32
+ // 6. 相对路径
33
+ "^\\./",
34
+ "^\\.\\./",
35
+ // 7. 样式文件
36
+ ".*\\.(css|scss|sass|less)$",
37
+ ],
38
+ importOrderSeparation: false,
39
+ importOrderSortSpecifiers: false,
40
+ importOrderParserPlugins: ["typescript", "jsx"],
19
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgzair/prettier-config-cgz",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Prettier shareable configuration for cgz frontend Guidelines",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -18,10 +18,12 @@
18
18
  "README.md"
19
19
  ],
20
20
  "dependencies": {
21
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
21
22
  "prettier": "^2.5.1",
22
23
  "prettier-plugin-two-style-order": "^1.0.1"
23
24
  },
24
25
  "devDependencies": {
26
+ "@vue/compiler-sfc": "^3.5.25",
25
27
  "jest": "^27.3.1"
26
28
  },
27
29
  "publishConfig": {
@@ -48,5 +50,5 @@
48
50
  "cobertura"
49
51
  ]
50
52
  },
51
- "gitHead": "ac4f859f68745c4250c8aab06047ce03b0de733e"
53
+ "gitHead": "3a4574921944b4fe24845b24ae0bfbfac622fbc7"
52
54
  }