@bhsd/code-standard 2.4.2 → 2.5.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.
- package/README.md +0 -1
- package/eslint.mjs +40 -11
- package/package.json +6 -6
package/README.md
CHANGED
package/eslint.mjs
CHANGED
|
@@ -14,9 +14,10 @@ import globals from 'globals';
|
|
|
14
14
|
|
|
15
15
|
const tsRecommended = typescriptEslint.configs['flat/recommended-type-checked'],
|
|
16
16
|
files = ['**/*.ts'];
|
|
17
|
-
const getConfig = rules => ({
|
|
17
|
+
const getConfig = (rules, ecmaVersion) => ({
|
|
18
18
|
languageOptions: {
|
|
19
19
|
globals: globals.browser,
|
|
20
|
+
...ecmaVersion && {ecmaVersion},
|
|
20
21
|
},
|
|
21
22
|
plugins: {'es-x': esX},
|
|
22
23
|
settings: {
|
|
@@ -24,7 +25,16 @@ const getConfig = rules => ({
|
|
|
24
25
|
aggressive: true,
|
|
25
26
|
},
|
|
26
27
|
},
|
|
27
|
-
rules
|
|
28
|
+
rules: {
|
|
29
|
+
...rules,
|
|
30
|
+
'es-x/no-iterator-prototype-every': 0,
|
|
31
|
+
'es-x/no-iterator-prototype-filter': 0,
|
|
32
|
+
'es-x/no-iterator-prototype-find': 0,
|
|
33
|
+
'es-x/no-iterator-prototype-foreach': 0,
|
|
34
|
+
'es-x/no-iterator-prototype-map': 0,
|
|
35
|
+
'es-x/no-iterator-prototype-reduce': 0,
|
|
36
|
+
'es-x/no-iterator-prototype-some': 0,
|
|
37
|
+
},
|
|
28
38
|
});
|
|
29
39
|
export const ignores = {
|
|
30
40
|
ignores: [
|
|
@@ -690,7 +700,6 @@ export const ignores = {
|
|
|
690
700
|
'jsdoc/no-bad-blocks': [
|
|
691
701
|
1,
|
|
692
702
|
{
|
|
693
|
-
ignore: ['__PURE__'],
|
|
694
703
|
preventAllMultiAsteriskBlocks: true,
|
|
695
704
|
},
|
|
696
705
|
],
|
|
@@ -1096,19 +1105,39 @@ export const ignores = {
|
|
|
1096
1105
|
'es-x/no-set-prototype-union': 2,
|
|
1097
1106
|
'es-x/no-string-prototype-iswellformed': 2,
|
|
1098
1107
|
'es-x/no-string-prototype-towellformed': 2,
|
|
1108
|
+
'unicorn/prefer-structured-clone': 0,
|
|
1109
|
+
}),
|
|
1110
|
+
browserES8 = getConfig({
|
|
1111
|
+
...esX.configs['flat/restrict-to-es2017'].rules,
|
|
1112
|
+
'es-x/no-array-prototype-flat': 0,
|
|
1113
|
+
'es-x/no-class-instance-fields': 0,
|
|
1114
|
+
'es-x/no-class-private-fields': 0,
|
|
1115
|
+
'es-x/no-class-private-methods': 0,
|
|
1116
|
+
'es-x/no-class-static-blocks': 0,
|
|
1117
|
+
'es-x/no-class-static-fields': 0,
|
|
1118
|
+
'es-x/no-private-in': 0,
|
|
1119
|
+
'es-x/no-logical-assignment-operators': 0,
|
|
1120
|
+
'es-x/no-numeric-separators': 0,
|
|
1121
|
+
'es-x/no-nullish-coalescing-operator': 0,
|
|
1122
|
+
'es-x/no-optional-chaining': 0,
|
|
1123
|
+
'es-x/no-optional-catch-binding': 0,
|
|
1124
|
+
'es-x/no-rest-spread-properties': 0,
|
|
1125
|
+
'unicorn/prefer-at': 0,
|
|
1126
|
+
'unicorn/prefer-bigint-literals': 0,
|
|
1127
|
+
'unicorn/prefer-global-this': 0,
|
|
1128
|
+
'unicorn/prefer-object-from-entries': 0,
|
|
1129
|
+
'unicorn/prefer-string-replace-all': 0,
|
|
1130
|
+
'unicorn/prefer-structured-clone': 0,
|
|
1099
1131
|
}),
|
|
1100
1132
|
dist = getConfig({
|
|
1101
1133
|
...esX.configs['flat/restrict-to-es2022'].rules,
|
|
1102
1134
|
'es-x/no-array-prototype-findlast-findlastindex': 0,
|
|
1103
|
-
'es-x/no-iterator-prototype-every': 0,
|
|
1104
|
-
'es-x/no-iterator-prototype-filter': 0,
|
|
1105
|
-
'es-x/no-iterator-prototype-find': 0,
|
|
1106
1135
|
'es-x/no-iterator-prototype-flatmap': 0,
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
'
|
|
1110
|
-
'es-x/no-
|
|
1111
|
-
});
|
|
1136
|
+
}),
|
|
1137
|
+
distES8 = getConfig({
|
|
1138
|
+
...esX.configs['flat/restrict-to-es2017'].rules,
|
|
1139
|
+
'es-x/no-array-prototype-flat': 0,
|
|
1140
|
+
}, 8);
|
|
1112
1141
|
|
|
1113
1142
|
/**
|
|
1114
1143
|
* 添加ESLint配置项
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bhsd/code-standard",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"homepage": "https://github.com/bhsd-harry/code-standard#readme",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/bhsd-harry/code-standard/issues"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@eslint/js": "^10.0.1",
|
|
23
23
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
|
|
24
24
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
25
|
-
"@typescript-eslint/eslint-plugin": "^8.59.
|
|
25
|
+
"@typescript-eslint/eslint-plugin": "^8.59.4",
|
|
26
26
|
"eslint-plugin-es-x": "^9.6.0",
|
|
27
27
|
"eslint-plugin-jsdoc": "^62.9.0",
|
|
28
28
|
"eslint-plugin-jsonc": "^3.1.2",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"globals": "^17.6.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/node": "^
|
|
38
|
-
"@typescript-eslint/parser": "^8.59.
|
|
39
|
-
"eslint": "^10.
|
|
40
|
-
"stylelint-plugin-use-baseline": "^1.4.
|
|
37
|
+
"@types/node": "^25.9.0",
|
|
38
|
+
"@typescript-eslint/parser": "^8.59.4",
|
|
39
|
+
"eslint": "^10.4.0",
|
|
40
|
+
"stylelint-plugin-use-baseline": "^1.4.2"
|
|
41
41
|
}
|
|
42
42
|
}
|