@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darksheep/eslint",
3
- "version": "10.0.0",
3
+ "version": "10.0.1",
4
4
  "description": "A fairly complete (opinionated) eslint config",
5
5
  "repository": {
6
6
  "type": "git",
@@ -6,29 +6,39 @@
6
6
  * @returns {Linter.Config[]}
7
7
  */
8
8
  export function createEslintComplexityConfig() {
9
- return [ {
10
- name: 'darksheep/complexity',
11
- rules: {
12
- 'max-depth': [ 'error', 4 ],
13
- 'complexity': 'off',
14
- 'max-lines': [
15
- 'warn',
16
- {
17
- max: 512,
18
- skipBlankLines: true,
19
- skipComments: true,
20
- },
21
- ],
22
- 'max-lines-per-function': [
23
- 'warn',
24
- {
25
- max: 120,
26
- skipBlankLines: true,
27
- skipComments: true,
28
- },
29
- ],
30
- 'max-nested-callbacks': [ 'warn', 3 ],
31
- 'max-params': [ 'error', 5 ],
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
  }
@@ -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: false,
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
- name: 'typescript/custom',
37
- files: [
38
- ...await getCommonFiles(root),
39
- ...await getModuleFiles(root),
40
- ...getTypescriptFiles(),
41
- ],
42
- languageOptions: {
43
- parser: typescriptParser,
44
- sourceType: 'module',
45
- parserOptions: {
46
- projectService: true,
47
- warnOnUnsupportedTypeScriptVersion: false,
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
- plugins: {
51
- // @ts-expect-error -- I love that the ts plugin is not compatible...
52
- '@typescript-eslint': typescriptPlugin,
53
- },
54
- rules: {
55
- // Rules that fight with typescript
56
- 'constructor-super': 'off',
57
- 'dot-notation': 'off',
58
- 'getter-return': 'off',
59
- 'no-const-assign': 'off',
60
- 'no-dupe-args': 'off',
61
- 'no-dupe-class-members': 'off',
62
- 'no-dupe-keys': 'off',
63
- 'no-func-assign': 'off',
64
- 'no-import-assign': 'off',
65
- // 'no-new-symbol': 'off',
66
- 'no-obj-calls': 'off',
67
- 'no-redeclare': 'off',
68
- 'no-setter-return': 'off',
69
- 'no-this-before-super': 'off',
70
- 'no-undef': 'off',
71
- 'no-unreachable': 'off',
72
- 'no-unsafe-negation': 'off',
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
- // Rules that prevert some commmon ts issues
76
- 'no-var': 'error',
77
- 'prefer-rest-params': 'error',
78
- 'prefer-spread': 'error',
76
+ // Rules that prevert some commmon ts issues
77
+ 'no-var': 'error',
78
+ 'prefer-rest-params': 'error',
79
+ 'prefer-spread': 'error',
79
80
 
80
- // ts eslint recommended
81
- '@typescript-eslint/ban-ts-comment': 'error',
82
- '@typescript-eslint/no-empty-object-type': 'error',
83
- '@typescript-eslint/no-unsafe-function-type': 'error',
84
- '@typescript-eslint/no-wrapper-object-types': 'error',
85
- '@typescript-eslint/no-array-constructor': 'error',
86
- '@typescript-eslint/no-duplicate-enum-values': 'error',
87
- '@typescript-eslint/no-explicit-any': 'error',
88
- '@typescript-eslint/no-extra-non-null-assertion': 'error',
89
- '@typescript-eslint/no-misused-new': 'error',
90
- '@typescript-eslint/no-namespace': [ 'error', { allowDeclarations: true } ],
91
- '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
92
- '@typescript-eslint/no-this-alias': 'error',
93
- '@typescript-eslint/no-unnecessary-type-constraint': 'error',
94
- '@typescript-eslint/no-unsafe-declaration-merging': 'error',
95
- '@typescript-eslint/no-require-imports': 'error',
96
- '@typescript-eslint/prefer-as-const': 'error',
97
- '@typescript-eslint/triple-slash-reference': 'error',
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
- // custom extras
100
- '@typescript-eslint/adjacent-overload-signatures': 'off',
101
- '@typescript-eslint/array-type': 'error',
102
- '@typescript-eslint/await-thenable': 'warn',
103
- '@typescript-eslint/ban-tslint-comment': 'error',
104
- '@typescript-eslint/class-literal-property-style': 'off',
105
- '@typescript-eslint/class-methods-use-this': 'off',
106
- '@typescript-eslint/consistent-generic-constructors': 'off',
107
- '@typescript-eslint/consistent-indexed-object-style': [ 'error' ],
108
- '@typescript-eslint/consistent-return': 'off',
109
- '@typescript-eslint/consistent-type-assertions': 'off',
110
- '@typescript-eslint/consistent-type-definitions': [ 'error', 'type' ],
111
- '@typescript-eslint/consistent-type-exports': [ 'error', { fixMixedExportsWithInlineTypeSpecifier: true } ],
112
- '@typescript-eslint/consistent-type-imports': [ 'error', {
113
- fixStyle: 'inline-type-imports',
114
- prefer: 'type-imports',
115
- } ],
116
- '@typescript-eslint/default-param-last': 'off',
117
- '@typescript-eslint/dot-notation': 'error',
118
- '@typescript-eslint/explicit-function-return-type': 'off',
119
- '@typescript-eslint/explicit-member-accessibility': 'off',
120
- '@typescript-eslint/explicit-module-boundary-types': 'off',
121
- '@typescript-eslint/init-declarations': 'off',
122
- '@typescript-eslint/max-params': 'off',
123
- '@typescript-eslint/member-ordering': 'off',
124
- '@typescript-eslint/method-signature-style': 'off',
125
- '@typescript-eslint/naming-convention': 'off',
126
- '@typescript-eslint/no-array-delete': 'error',
127
- '@typescript-eslint/no-base-to-string': 'warn',
128
- '@typescript-eslint/no-confusing-non-null-assertion': 'warn',
129
- '@typescript-eslint/no-confusing-void-expression': 'warn',
130
- '@typescript-eslint/no-deprecated': 'error',
131
- '@typescript-eslint/only-throw-error': 'error',
132
- '@typescript-eslint/prefer-destructuring': 'off',
133
- '@typescript-eslint/prefer-enum-initializers': 'off',
134
- '@typescript-eslint/prefer-find': 'error',
135
- '@typescript-eslint/prefer-for-of': 'error',
136
- '@typescript-eslint/prefer-function-type': 'off',
137
- '@typescript-eslint/prefer-includes': 'error',
138
- '@typescript-eslint/prefer-literal-enum-member': 'off',
139
- '@typescript-eslint/prefer-namespace-keyword': 'off',
140
- '@typescript-eslint/prefer-nullish-coalescing': 'error',
141
- '@typescript-eslint/prefer-optional-chain': 'error',
142
- '@typescript-eslint/prefer-promise-reject-errors': 'error',
143
- '@typescript-eslint/prefer-readonly-parameter-types': 'off',
144
- '@typescript-eslint/prefer-readonly': 'off',
145
- '@typescript-eslint/prefer-reduce-type-parameter': 'off',
146
- '@typescript-eslint/prefer-regexp-exec': 'off',
147
- '@typescript-eslint/prefer-return-this-type': 'off',
148
- '@typescript-eslint/prefer-string-starts-ends-with': 'error',
149
- '@typescript-eslint/promise-function-async': 'off',
150
- '@typescript-eslint/related-getter-setter-pairs': 'off',
151
- '@typescript-eslint/require-array-sort-compare': 'off',
152
- '@typescript-eslint/require-await': 'off',
153
- '@typescript-eslint/restrict-plus-operands': 'error',
154
- '@typescript-eslint/restrict-template-expressions': 'off',
155
- '@typescript-eslint/return-await': [ 'warn', 'always' ],
156
- '@typescript-eslint/strict-boolean-expressions': 'error',
157
- '@typescript-eslint/switch-exhaustiveness-check': 'off',
158
- '@typescript-eslint/typedef': 'off',
159
- '@typescript-eslint/unbound-method': 'off',
160
- '@typescript-eslint/unified-signatures': [ 'warn', { ignoreDifferentlyNamedParameters: true } ],
161
- '@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
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
  }
@@ -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': 'warn',
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',