@zpcscc/configs 2.0.2 → 2.0.4

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.
@@ -53,6 +53,8 @@ module.exports = {
53
53
  rules: {
54
54
  // 数组类型。这里不限制写法
55
55
  '@typescript-eslint/array-type': 'off',
56
+ // 强制要求注释描述,这里关闭
57
+ '@typescript-eslint/ban-ts-comment': 'off',
56
58
  // 强制使用一致性类型断言。<>语法,或者as语法
57
59
  '@typescript-eslint/consistent-type-assertions': 'off',
58
60
  // 强制ts类型使用type关键字,好处是,type关键字可以让ts类型更加明确,鼠标悬浮可以显示具体类型,且有interface的所有功能;
@@ -82,6 +84,8 @@ module.exports = {
82
84
  allowShortCircuit: true,
83
85
  allowTernary: true
84
86
  }],
87
+ // 禁止使用类型断言,应使用 !进行断言,这里关闭。类型断言更语意化,会好些。
88
+ '@typescript-eslint/non-nullable-type-assertion-style': 'off',
85
89
  // 限制命名规则。这里关闭。命名希望灵活些
86
90
  '@typescript-eslint/naming-convention': 'off',
87
91
  // 为了安全使用 ?? 替换 ||。关闭此选项,部分场景,需要手动选择??还是||; ??会把空字符串也认为是true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zpcscc/configs",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "项目通用配置",
5
5
  "keywords": [
6
6
  "commitlint",
@@ -43,58 +43,58 @@
43
43
  "start": "dumi dev"
44
44
  },
45
45
  "dependencies": {
46
- "@babel/core": "7.23.5",
47
- "@babel/plugin-syntax-flow": "7.23.3",
46
+ "@babel/core": "7.24.5",
47
+ "@babel/plugin-syntax-flow": "7.24.1",
48
48
  "@babel/plugin-transform-react-jsx": "7.23.4",
49
- "@babel/runtime": "7.23.5",
50
- "@commitlint/cz-commitlint": "18.4.3",
51
- "@rushstack/eslint-patch": "1.6.0",
52
- "@types/node": "20.10.1",
53
- "@types/react": "18.2.39",
54
- "@types/react-dom": "18.2.17",
55
- "@typescript-eslint/eslint-plugin": "6.13.1",
56
- "@typescript-eslint/parser": "6.13.1",
57
- "@vue/eslint-config-prettier": "8.0.0",
58
- "@vue/eslint-config-typescript": "12.0.0",
49
+ "@babel/runtime": "7.24.5",
50
+ "@commitlint/cz-commitlint": "19.2.0",
51
+ "@rushstack/eslint-patch": "1.10.2",
52
+ "@types/node": "20.12.12",
53
+ "@types/react": "18.3.2",
54
+ "@types/react-dom": "18.3.0",
55
+ "@typescript-eslint/eslint-plugin": "6.21.0",
56
+ "@typescript-eslint/parser": "6.19.1",
57
+ "@vue/eslint-config-prettier": "9.0.0",
58
+ "@vue/eslint-config-typescript": "13.0.0",
59
59
  "commitizen": "4.3.0",
60
60
  "cosmiconfig": "9.0.0",
61
- "eslint": "8.54.0",
62
- "eslint-config-prettier": "9.0.0",
61
+ "eslint": "8.57.0",
62
+ "eslint-config-prettier": "9.1.0",
63
63
  "eslint-config-standard": "17.1.0",
64
- "eslint-config-standard-with-typescript": "40.0.0",
64
+ "eslint-config-standard-with-typescript": "43.0.1",
65
65
  "eslint-import-resolver-typescript": "3.6.1",
66
66
  "eslint-plugin-eslint-comments": "3.2.0",
67
- "eslint-plugin-import": "2.29.0",
67
+ "eslint-plugin-import": "2.29.1",
68
68
  "eslint-plugin-jsx-a11y": "6.8.0",
69
- "eslint-plugin-n": "16.3.1",
70
- "eslint-plugin-prettier": "5.0.1",
69
+ "eslint-plugin-n": "16.6.2",
70
+ "eslint-plugin-prettier": "5.1.3",
71
71
  "eslint-plugin-promise": "6.1.1",
72
- "eslint-plugin-react": "7.33.2",
73
- "eslint-plugin-react-hooks": "4.6.0",
74
- "eslint-plugin-sonarjs": "0.23.0",
75
- "eslint-plugin-unicorn": "49.0.0",
76
- "eslint-plugin-vue": "9.19.2",
77
- "inquirer": "8.2.5",
78
- "postcss": "8.4.31",
79
- "prettier": "3.1.0",
72
+ "eslint-plugin-react": "7.34.1",
73
+ "eslint-plugin-react-hooks": "4.6.2",
74
+ "eslint-plugin-sonarjs": "1.0.3",
75
+ "eslint-plugin-unicorn": "53.0.0",
76
+ "eslint-plugin-vue": "9.26.0",
77
+ "inquirer": "9.2.21",
78
+ "postcss": "8.4.38",
79
+ "prettier": "3.2.5",
80
80
  "prettier-plugin-organize-imports": "3.2.4",
81
- "prettier-plugin-packagejson": "2.4.6",
81
+ "prettier-plugin-packagejson": "2.5.0",
82
82
  "stylelint": "14.16.1",
83
- "stylelint-config-idiomatic-order": "9.0.0",
84
- "stylelint-declaration-block-no-ignored-properties": "2.7.0",
85
- "vue-eslint-parser": "9.3.2"
83
+ "stylelint-config-idiomatic-order": "10.0.0",
84
+ "stylelint-declaration-block-no-ignored-properties": "2.8.0",
85
+ "typescript": "5.4.5",
86
+ "vue-eslint-parser": "9.4.2"
86
87
  },
87
88
  "devDependencies": {
88
- "dumi": "2.2.14",
89
- "father": "4.3.7",
90
- "gh-pages": "6.1.0",
91
- "react": "18.2.0",
92
- "react-dom": "18.2.0",
93
- "react-is": "18.2.0",
94
- "styled-components": "6.1.1",
89
+ "dumi": "2.3.4",
90
+ "father": "4.4.1",
91
+ "gh-pages": "6.1.1",
92
+ "react": "18.3.1",
93
+ "react-dom": "18.3.1",
94
+ "react-is": "18.3.1",
95
+ "styled-components": "6.1.11",
95
96
  "tslib": "2.6.2",
96
- "typescript": "5.3.2",
97
- "webpack": "5.89.0"
97
+ "webpack": "5.91.0"
98
98
  },
99
99
  "publishConfig": {
100
100
  "access": "public",
@@ -2,9 +2,9 @@
2
2
  module.exports = {
3
3
  // 额外的插件
4
4
  plugins: [
5
- // import格式化时自动排序
5
+ // 格式化时对import自动排序
6
6
  require.resolve('prettier-plugin-organize-imports'),
7
- // package.json格式化时自动排序
7
+ // 格式化时对package.json自动排序
8
8
  require.resolve('prettier-plugin-packagejson')],
9
9
  // import格式化自动排序时,不删除未使用的import
10
10
  organizeImportsSkipDestructiveCodeActions: true,
package/types/any.d.ts CHANGED
@@ -1,6 +1,8 @@
1
- // * 一些通用any类型定义
1
+ // * 一些通用any类型定义,通常用于没有类型的第三方库,不要滥用any
2
2
 
3
- // 任意函数类型
4
- type AnyFunction = (...args: any[]) => any;
3
+ // 任意值
4
+ type Any = any;
5
5
  // 任意对象类型
6
6
  type AnyObject = Record<string, any>;
7
+ // 任意函数类型
8
+ type AnyFunction = (...args: any[]) => any;