@apdesign/code-style-react 2.0.0 → 2.0.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 (3) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/biome.jsonc +35 -27
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # 更新日志
2
2
 
3
+ ## [2.0.1] - 规则放宽版本
4
+
5
+ ### 🔧 调整
6
+
7
+ - **放宽 Biome Linter 规则**: 参考原 ESLint 配置,将规则调整得更宽松
8
+ - 关闭文件命名约定检查 (`useFilenamingConvention`)
9
+ - 关闭 Node.js import 协议强制 (`useNodejsImportProtocol`)
10
+ - 关闭魔术数字检查 (`noMagicNumbers`)
11
+ - 关闭正则表达式顶层声明要求 (`useTopLevelRegex`)
12
+ - 关闭未使用函数参数检查 (`noUnusedFunctionParameters`)
13
+ - 关闭代码复杂度检查 (`noExcessiveCognitiveComplexity`)
14
+ - 关闭多余模板字符串检查 (`noUnusedTemplateLiteral`)
15
+ - 关闭否定判断优化建议 (`noNegationElse`)
16
+ - 将多个 `error` 级别降为 `warn` 级别
17
+ - 关闭类型约束相关的严格检查
18
+
19
+ ### 📝 说明
20
+
21
+ 此版本的规则配置更接近原 ESLint 的宽松风格,专注于必要的代码质量检查,避免过于严格的代码风格限制。
22
+
23
+ ---
24
+
3
25
  ## [2.0.0] - Ultracite 迁移版本
4
26
 
5
27
  ### 🎉 重大变更
package/biome.jsonc CHANGED
@@ -31,37 +31,57 @@
31
31
  "useKeyWithClickEvents": "off"
32
32
  },
33
33
  "complexity": {
34
- "noBannedTypes": "error",
34
+ "noBannedTypes": "off",
35
35
  "noUselessConstructor": "error",
36
36
  "noUselessFragments": "off",
37
- "noUselessTypeConstraint": "error",
38
- "noForEach": "off"
37
+ "noUselessTypeConstraint": "off",
38
+ "noForEach": "off",
39
+ "noExcessiveCognitiveComplexity": "off",
40
+ "noVoid": "off"
39
41
  },
40
42
  "correctness": {
41
- "noPrecisionLoss": "error",
43
+ "noPrecisionLoss": "warn",
42
44
  "noUndeclaredVariables": "off",
43
45
  "noUnusedVariables": "warn",
44
- "useExhaustiveDependencies": "off"
46
+ "noUnusedImports": "warn",
47
+ "noUnusedPrivateClassMembers": "warn",
48
+ "noUnusedFunctionParameters": "off",
49
+ "useExhaustiveDependencies": "off",
50
+ "noEmptyCharacterClassInRegex": "warn"
45
51
  },
46
52
  "style": {
47
- "noNamespace": "error",
53
+ "noNamespace": "off",
48
54
  "noParameterAssign": "warn",
49
- "useArrayLiterals": "error",
50
- "useAsConstAssertion": "error",
55
+ "noNonNullAssertion": "off",
56
+ "useArrayLiterals": "off",
57
+ "useAsConstAssertion": "off",
51
58
  "useBlockStatements": "off",
52
59
  "useNamingConvention": "off",
53
60
  "useTemplate": "warn",
54
- "useFilenamingConvention": "off"
61
+ "useFilenamingConvention": "off",
62
+ "useNumberNamespace": "off",
63
+ "useNodejsImportProtocol": "off",
64
+ "noUnusedTemplateLiteral": "off",
65
+ "useExponentiationOperator": "warn",
66
+ "noNegationElse": "off",
67
+ "noMagicNumbers": "off"
55
68
  },
56
69
  "suspicious": {
57
- "noEmptyBlockStatements": "error",
70
+ "noEmptyBlockStatements": "warn",
58
71
  "noExplicitAny": "warn",
59
- "noExtraNonNullAssertion": "error",
60
- "noMisleadingInstantiator": "error",
61
- "noUnsafeDeclarationMerging": "error",
72
+ "noExtraNonNullAssertion": "warn",
73
+ "noMisleadingInstantiator": "warn",
74
+ "noUnsafeDeclarationMerging": "warn",
62
75
  "noArrayIndexKey": "warn",
63
76
  "noShadowRestrictedNames": "warn",
64
- "noConsole": "off"
77
+ "noConsole": "off",
78
+ "noDoubleEquals": "off",
79
+ "noPrototypeBuiltins": "off"
80
+ },
81
+ "performance": {
82
+ "noAccumulatingSpread": "off",
83
+ "noDelete": "off",
84
+ "useTopLevelRegex": "off"
65
85
  }
66
86
  }
67
87
  },
@@ -83,17 +103,5 @@
83
103
  "**/build/**",
84
104
  "**/coverage/**"
85
105
  ]
86
- },
87
- "overrides": [
88
- {
89
- "includes": ["scripts/runEslint.js", "scripts/runStylelint.js"],
90
- "linter": {
91
- "rules": {
92
- "complexity": {
93
- "noExcessiveCognitiveComplexity": "off"
94
- }
95
- }
96
- }
97
- }
98
- ]
106
+ }
99
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apdesign/code-style-react",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "基于 Ultracite (Biome) 的现代化前端代码规范工具集,专为 React/TypeScript 项目设计",
5
5
  "keywords": [
6
6
  "biome",