@zpcscc/configs 2.0.4 → 2.0.6

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.
@@ -23,15 +23,13 @@ module.exports = {
23
23
  'plugin:unicorn/recommended',
24
24
  // 对promise的推荐配置
25
25
  'plugin:promise/recommended',
26
- // sonarjs的推荐配置
27
- 'plugin:sonarjs/recommended',
28
26
  /**
29
27
  * eslint-plugin-prettier的推荐配置,需要放在最后一位,内部启用了eslint-plugin-prettier插件
30
28
  * 用于关闭eslint中的所有格式化配置,全部在.prettierrc中进行格式化配置
31
29
  */
32
30
  'plugin:prettier/recommended'],
33
31
  // 如果要在rules中针对某个插件做具体配置,则需要在plugins里先引入对应插件
34
- plugins: ['@typescript-eslint', 'sonarjs', 'unicorn', 'promise', 'import'],
32
+ plugins: ['@typescript-eslint', 'unicorn', 'promise', 'import'],
35
33
  parserOptions: {
36
34
  ecmaVersion: 'latest'
37
35
  },
@@ -59,8 +57,10 @@ module.exports = {
59
57
  '@typescript-eslint/consistent-type-assertions': 'off',
60
58
  // 强制ts类型使用type关键字,好处是,type关键字可以让ts类型更加明确,鼠标悬浮可以显示具体类型,且有interface的所有功能;
61
59
  '@typescript-eslint/consistent-type-definitions': ['error', 'type'],
62
- // import 类型时,需要加 type
63
- '@typescript-eslint/consistent-type-imports': 'error',
60
+ // import 类型时,需要加 type,使用内联方式。 import { type FC } from 'react'
61
+ '@typescript-eslint/consistent-type-imports': ['error', {
62
+ fixStyle: 'inline-type-imports'
63
+ }],
64
64
  // 显示函数返回类型。关闭此校验,部分函数没有返回值。无需每个都显示类型
65
65
  '@typescript-eslint/explicit-function-return-type': 'off',
66
66
  /**
@@ -123,8 +123,6 @@ module.exports = {
123
123
  'no-unused-expressions': 'off',
124
124
  // 函数名称后需要跟一个空格。这里关闭
125
125
  'space-before-function-paren': 'off',
126
- // 返回值必须被使用。这里关闭
127
- 'sonarjs/no-ignored-return': 'off',
128
126
  // 在属性上使用析构函数变量。这里关闭
129
127
  'unicorn/consistent-destructuring': 'off',
130
128
  // 箭头函数移动到外部作用于。这里关闭。在react组件内,经常会使用到箭头函数
@@ -242,11 +240,6 @@ module.exports = {
242
240
  quotes: ['error'],
243
241
  'require-atomic-updates': ['error'],
244
242
  semi: ['error', 'always'],
245
- 'sonarjs/cognitive-complexity': 'off',
246
- 'sonarjs/no-nested-template-literals': 'off',
247
- 'sonarjs/no-duplicate-string': 'off',
248
- 'sonarjs/no-small-switch': 'off',
249
- 'sonarjs/prefer-immediate-return': 'off',
250
243
  'space-before-blocks': ['error', 'always'],
251
244
  'space-in-parens': ['error', 'never'],
252
245
  'space-unary-ops': ['error', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zpcscc/configs",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "项目通用配置",
5
5
  "keywords": [
6
6
  "commitlint",
@@ -43,14 +43,14 @@
43
43
  "start": "dumi dev"
44
44
  },
45
45
  "dependencies": {
46
- "@babel/core": "7.24.5",
47
- "@babel/plugin-syntax-flow": "7.24.1",
48
- "@babel/plugin-transform-react-jsx": "7.23.4",
49
- "@babel/runtime": "7.24.5",
46
+ "@babel/core": "7.24.7",
47
+ "@babel/plugin-syntax-flow": "7.24.7",
48
+ "@babel/plugin-transform-react-jsx": "7.24.7",
49
+ "@babel/runtime": "7.24.7",
50
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",
51
+ "@rushstack/eslint-patch": "1.10.3",
52
+ "@types/node": "20.14.2",
53
+ "@types/react": "18.3.3",
54
54
  "@types/react-dom": "18.3.0",
55
55
  "@typescript-eslint/eslint-plugin": "6.21.0",
56
56
  "@typescript-eslint/parser": "6.19.1",
@@ -68,32 +68,31 @@
68
68
  "eslint-plugin-jsx-a11y": "6.8.0",
69
69
  "eslint-plugin-n": "16.6.2",
70
70
  "eslint-plugin-prettier": "5.1.3",
71
- "eslint-plugin-promise": "6.1.1",
72
- "eslint-plugin-react": "7.34.1",
71
+ "eslint-plugin-promise": "6.2.0",
72
+ "eslint-plugin-react": "7.34.2",
73
73
  "eslint-plugin-react-hooks": "4.6.2",
74
- "eslint-plugin-sonarjs": "1.0.3",
75
74
  "eslint-plugin-unicorn": "53.0.0",
76
75
  "eslint-plugin-vue": "9.26.0",
77
- "inquirer": "9.2.21",
76
+ "inquirer": "9.2.23",
78
77
  "postcss": "8.4.38",
79
- "prettier": "3.2.5",
78
+ "prettier": "3.3.1",
80
79
  "prettier-plugin-organize-imports": "3.2.4",
81
80
  "prettier-plugin-packagejson": "2.5.0",
82
81
  "stylelint": "14.16.1",
83
82
  "stylelint-config-idiomatic-order": "10.0.0",
84
83
  "stylelint-declaration-block-no-ignored-properties": "2.8.0",
85
84
  "typescript": "5.4.5",
86
- "vue-eslint-parser": "9.4.2"
85
+ "vue-eslint-parser": "9.4.3"
87
86
  },
88
87
  "devDependencies": {
89
- "dumi": "2.3.4",
90
- "father": "4.4.1",
88
+ "dumi": "2.3.8",
89
+ "father": "4.4.4",
91
90
  "gh-pages": "6.1.1",
92
91
  "react": "18.3.1",
93
92
  "react-dom": "18.3.1",
94
93
  "react-is": "18.3.1",
95
94
  "styled-components": "6.1.11",
96
- "tslib": "2.6.2",
95
+ "tslib": "2.6.3",
97
96
  "webpack": "5.91.0"
98
97
  },
99
98
  "publishConfig": {