@darksheep/eslint 10.0.0 → 10.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.
- package/CHANGELOG.md +11 -0
- package/package.json +1 -1
- package/src/configs/eslint-complexity.js +34 -24
- package/src/plugins/jsdoc.js +1 -1
- package/src/plugins/typescript.js +132 -124
- package/src/plugins/unicorn.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [10.0.1](https://github.com/DarkSheepSoftware/eslint/compare/v10.0.0...v10.0.1) (2025-11-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### 🩹 Fixes
|
|
7
|
+
|
|
8
|
+
* Disable 'unicorn/require-module-specifiers' rule ([7d84b2f](https://github.com/DarkSheepSoftware/eslint/commit/7d84b2f8ee95485f88208aa0ad23ab8f50f7f3a4))
|
|
9
|
+
* make complexity rules softer in tests ([e374f0b](https://github.com/DarkSheepSoftware/eslint/commit/e374f0be288b9a9fca9b098aaa6c18ee816fac46))
|
|
10
|
+
* make import/export `type` not occur in js files ([49eaf45](https://github.com/DarkSheepSoftware/eslint/commit/49eaf45f2609f5887bd725465ad3f49bcd45f769))
|
|
11
|
+
* prefer-promise-reject-errors rule allowThrowingUnknown: true ([14ec8b4](https://github.com/DarkSheepSoftware/eslint/commit/14ec8b4015327d696591570076e5338bfeccbccc))
|
|
12
|
+
* Set `exemptTypedefs: true` in `jsdoc/prefer-import-tag` ([e1ec731](https://github.com/DarkSheepSoftware/eslint/commit/e1ec7319987512b818d3ad81e9f148e8edb6f14d))
|
|
13
|
+
|
|
3
14
|
## [10.0.0](https://github.com/DarkSheepSoftware/eslint/compare/v9.0.2...v10.0.0) (2025-11-11)
|
|
4
15
|
|
|
5
16
|
|
package/package.json
CHANGED
|
@@ -6,29 +6,39 @@
|
|
|
6
6
|
* @returns {Linter.Config[]}
|
|
7
7
|
*/
|
|
8
8
|
export function createEslintComplexityConfig() {
|
|
9
|
-
return [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
'
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
name: 'darksheep/complexity',
|
|
12
|
+
rules: {
|
|
13
|
+
'max-depth': [ 'error', 4 ],
|
|
14
|
+
'complexity': 'off',
|
|
15
|
+
'max-lines': [
|
|
16
|
+
'warn',
|
|
17
|
+
{
|
|
18
|
+
max: 512,
|
|
19
|
+
skipBlankLines: true,
|
|
20
|
+
skipComments: true,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
'max-lines-per-function': [
|
|
24
|
+
'warn',
|
|
25
|
+
{
|
|
26
|
+
max: 120,
|
|
27
|
+
skipBlankLines: true,
|
|
28
|
+
skipComments: true,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
'max-nested-callbacks': [ 'warn', 3 ],
|
|
32
|
+
'max-params': [ 'error', 5 ],
|
|
33
|
+
},
|
|
32
34
|
},
|
|
33
|
-
|
|
35
|
+
{
|
|
36
|
+
files: [ '**/*.test.*' ],
|
|
37
|
+
rules: {
|
|
38
|
+
'max-lines': 'off',
|
|
39
|
+
'max-lines-per-function': 'off',
|
|
40
|
+
'max-nested-callbacks': [ 'warn', 5 ],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
];
|
|
34
44
|
}
|
package/src/plugins/jsdoc.js
CHANGED
|
@@ -93,7 +93,7 @@ export async function createEslintJSDocConfig(root) {
|
|
|
93
93
|
'jsdoc/escape-inline-tags': [ 'error', { enableFixer: true, fixType: 'backslash' } ],
|
|
94
94
|
'jsdoc/prefer-import-tag': [ 'warn', {
|
|
95
95
|
outputType: 'named-import',
|
|
96
|
-
exemptTypedefs:
|
|
96
|
+
exemptTypedefs: true,
|
|
97
97
|
} ],
|
|
98
98
|
'jsdoc/reject-any-type': 'warn',
|
|
99
99
|
'jsdoc/reject-function-type': 'warn',
|
|
@@ -32,133 +32,141 @@ export async function createEslintTypescriptConfig(root) {
|
|
|
32
32
|
const typescriptParser = idef(await import('@typescript-eslint/parser'));
|
|
33
33
|
const typescriptPlugin = idef(await import('@typescript-eslint/eslint-plugin'));
|
|
34
34
|
|
|
35
|
-
return [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
name: 'typescript/base',
|
|
38
|
+
files: [
|
|
39
|
+
...await getCommonFiles(root),
|
|
40
|
+
...await getModuleFiles(root),
|
|
41
|
+
...getTypescriptFiles(),
|
|
42
|
+
],
|
|
43
|
+
languageOptions: {
|
|
44
|
+
parser: typescriptParser,
|
|
45
|
+
sourceType: 'module',
|
|
46
|
+
parserOptions: {
|
|
47
|
+
projectService: true,
|
|
48
|
+
warnOnUnsupportedTypeScriptVersion: false,
|
|
49
|
+
},
|
|
48
50
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
'no-array-constructor': 'off',
|
|
51
|
+
plugins: {
|
|
52
|
+
// @ts-expect-error -- I love that the ts plugin is not compatible...
|
|
53
|
+
'@typescript-eslint': typescriptPlugin,
|
|
54
|
+
},
|
|
55
|
+
rules: {
|
|
56
|
+
// Rules that fight with typescript
|
|
57
|
+
'constructor-super': 'off',
|
|
58
|
+
'dot-notation': 'off',
|
|
59
|
+
'getter-return': 'off',
|
|
60
|
+
'no-const-assign': 'off',
|
|
61
|
+
'no-dupe-args': 'off',
|
|
62
|
+
'no-dupe-class-members': 'off',
|
|
63
|
+
'no-dupe-keys': 'off',
|
|
64
|
+
'no-func-assign': 'off',
|
|
65
|
+
'no-import-assign': 'off',
|
|
66
|
+
// 'no-new-symbol': 'off',
|
|
67
|
+
'no-obj-calls': 'off',
|
|
68
|
+
'no-redeclare': 'off',
|
|
69
|
+
'no-setter-return': 'off',
|
|
70
|
+
'no-this-before-super': 'off',
|
|
71
|
+
'no-undef': 'off',
|
|
72
|
+
'no-unreachable': 'off',
|
|
73
|
+
'no-unsafe-negation': 'off',
|
|
74
|
+
'no-array-constructor': 'off',
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
// Rules that prevert some commmon ts issues
|
|
77
|
+
'no-var': 'error',
|
|
78
|
+
'prefer-rest-params': 'error',
|
|
79
|
+
'prefer-spread': 'error',
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
81
|
+
// ts eslint recommended
|
|
82
|
+
'@typescript-eslint/ban-ts-comment': 'error',
|
|
83
|
+
'@typescript-eslint/no-empty-object-type': 'error',
|
|
84
|
+
'@typescript-eslint/no-unsafe-function-type': 'error',
|
|
85
|
+
'@typescript-eslint/no-wrapper-object-types': 'error',
|
|
86
|
+
'@typescript-eslint/no-array-constructor': 'error',
|
|
87
|
+
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
88
|
+
'@typescript-eslint/no-explicit-any': 'error',
|
|
89
|
+
'@typescript-eslint/no-extra-non-null-assertion': 'error',
|
|
90
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
91
|
+
'@typescript-eslint/no-namespace': [ 'error', { allowDeclarations: true } ],
|
|
92
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
93
|
+
'@typescript-eslint/no-this-alias': 'error',
|
|
94
|
+
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
|
|
95
|
+
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
96
|
+
'@typescript-eslint/no-require-imports': 'error',
|
|
97
|
+
'@typescript-eslint/prefer-as-const': 'error',
|
|
98
|
+
'@typescript-eslint/triple-slash-reference': 'error',
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
'
|
|
161
|
-
|
|
100
|
+
// custom extras
|
|
101
|
+
'@typescript-eslint/adjacent-overload-signatures': 'off',
|
|
102
|
+
'@typescript-eslint/array-type': 'error',
|
|
103
|
+
'@typescript-eslint/await-thenable': 'warn',
|
|
104
|
+
'@typescript-eslint/ban-tslint-comment': 'error',
|
|
105
|
+
'@typescript-eslint/class-literal-property-style': 'off',
|
|
106
|
+
'@typescript-eslint/class-methods-use-this': 'off',
|
|
107
|
+
'@typescript-eslint/consistent-generic-constructors': 'off',
|
|
108
|
+
'@typescript-eslint/consistent-indexed-object-style': [ 'error' ],
|
|
109
|
+
'@typescript-eslint/consistent-return': 'off',
|
|
110
|
+
'@typescript-eslint/consistent-type-assertions': 'off',
|
|
111
|
+
'@typescript-eslint/consistent-type-definitions': [ 'error', 'type' ],
|
|
112
|
+
'@typescript-eslint/default-param-last': 'off',
|
|
113
|
+
'@typescript-eslint/dot-notation': 'error',
|
|
114
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
115
|
+
'@typescript-eslint/explicit-member-accessibility': 'off',
|
|
116
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
117
|
+
'@typescript-eslint/init-declarations': 'off',
|
|
118
|
+
'@typescript-eslint/max-params': 'off',
|
|
119
|
+
'@typescript-eslint/member-ordering': 'off',
|
|
120
|
+
'@typescript-eslint/method-signature-style': 'off',
|
|
121
|
+
'@typescript-eslint/naming-convention': 'off',
|
|
122
|
+
'@typescript-eslint/no-array-delete': 'error',
|
|
123
|
+
'@typescript-eslint/no-base-to-string': 'warn',
|
|
124
|
+
'@typescript-eslint/no-confusing-non-null-assertion': 'warn',
|
|
125
|
+
'@typescript-eslint/no-confusing-void-expression': 'warn',
|
|
126
|
+
'@typescript-eslint/no-deprecated': 'error',
|
|
127
|
+
'@typescript-eslint/only-throw-error': 'error',
|
|
128
|
+
'@typescript-eslint/prefer-destructuring': 'off',
|
|
129
|
+
'@typescript-eslint/prefer-enum-initializers': 'off',
|
|
130
|
+
'@typescript-eslint/prefer-find': 'error',
|
|
131
|
+
'@typescript-eslint/prefer-for-of': 'error',
|
|
132
|
+
'@typescript-eslint/prefer-function-type': 'off',
|
|
133
|
+
'@typescript-eslint/prefer-includes': 'error',
|
|
134
|
+
'@typescript-eslint/prefer-literal-enum-member': 'off',
|
|
135
|
+
'@typescript-eslint/prefer-namespace-keyword': 'off',
|
|
136
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'error',
|
|
137
|
+
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
138
|
+
'@typescript-eslint/prefer-promise-reject-errors': [ 'error', { allowThrowingUnknown: true } ],
|
|
139
|
+
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
|
|
140
|
+
'@typescript-eslint/prefer-readonly': 'off',
|
|
141
|
+
'@typescript-eslint/prefer-reduce-type-parameter': 'off',
|
|
142
|
+
'@typescript-eslint/prefer-regexp-exec': 'off',
|
|
143
|
+
'@typescript-eslint/prefer-return-this-type': 'off',
|
|
144
|
+
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
|
|
145
|
+
'@typescript-eslint/promise-function-async': 'off',
|
|
146
|
+
'@typescript-eslint/related-getter-setter-pairs': 'off',
|
|
147
|
+
'@typescript-eslint/require-array-sort-compare': 'off',
|
|
148
|
+
'@typescript-eslint/require-await': 'off',
|
|
149
|
+
'@typescript-eslint/restrict-plus-operands': 'error',
|
|
150
|
+
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
151
|
+
'@typescript-eslint/return-await': [ 'warn', 'always' ],
|
|
152
|
+
'@typescript-eslint/strict-boolean-expressions': 'error',
|
|
153
|
+
'@typescript-eslint/switch-exhaustiveness-check': 'off',
|
|
154
|
+
'@typescript-eslint/typedef': 'off',
|
|
155
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
156
|
+
'@typescript-eslint/unified-signatures': [ 'warn', { ignoreDifferentlyNamedParameters: true } ],
|
|
157
|
+
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: 'typescript/ts',
|
|
162
|
+
files: getTypescriptFiles(),
|
|
163
|
+
rules: {
|
|
164
|
+
'@typescript-eslint/consistent-type-exports': [ 'error', { fixMixedExportsWithInlineTypeSpecifier: true } ],
|
|
165
|
+
'@typescript-eslint/consistent-type-imports': [ 'error', {
|
|
166
|
+
fixStyle: 'inline-type-imports',
|
|
167
|
+
prefer: 'type-imports',
|
|
168
|
+
} ],
|
|
169
|
+
},
|
|
162
170
|
},
|
|
163
|
-
|
|
171
|
+
];
|
|
164
172
|
}
|
package/src/plugins/unicorn.js
CHANGED
|
@@ -155,7 +155,7 @@ export async function createEslintUnicornConfig(root) {
|
|
|
155
155
|
'unicorn/relative-url-style': 'error',
|
|
156
156
|
'unicorn/require-array-join-separator': 'error',
|
|
157
157
|
'unicorn/require-module-attributes': 'warn',
|
|
158
|
-
'unicorn/require-module-specifiers': '
|
|
158
|
+
'unicorn/require-module-specifiers': 'off',
|
|
159
159
|
'unicorn/require-number-to-fixed-digits-argument': 'error',
|
|
160
160
|
'unicorn/require-post-message-target-origin': 'error',
|
|
161
161
|
'unicorn/string-content': 'off',
|