@darksheep/eslint 9.0.2 โ 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 +44 -0
- package/package.json +17 -17
- package/src/configs/eslint-complexity.js +34 -24
- package/src/custom-rules/instance-of-array.js +2 -1
- package/src/index.js +3 -3
- package/src/plugins/jsdoc.js +1 -1
- package/src/plugins/package-json.js +0 -1
- package/src/plugins/typescript.js +137 -121
- package/src/plugins/unicorn.js +1 -1
- package/src/utilities/expand-glob.js +2 -2
- package/src/utilities/filesystem.js +1 -1
- package/src/utilities/package.js +1 -1
- package/types/eslint.config.d.ts +1 -1
- package/types/src/custom-logger/index.d.ts +1 -2
- package/types/src/utilities/package.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
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
|
+
|
|
14
|
+
## [10.0.0](https://github.com/DarkSheepSoftware/eslint/compare/v9.0.2...v10.0.0) (2025-11-11)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### โ BREAKING CHANGES
|
|
18
|
+
|
|
19
|
+
* remove type-fest
|
|
20
|
+
* enable typescript on all files its possible too
|
|
21
|
+
|
|
22
|
+
### ๐ Features
|
|
23
|
+
|
|
24
|
+
* enable return-await always ([9fd081b](https://github.com/DarkSheepSoftware/eslint/commit/9fd081b2d052fa41bdb870bc4455db0368b38f98))
|
|
25
|
+
* enable typescript on all files its possible too ([4f6d617](https://github.com/DarkSheepSoftware/eslint/commit/4f6d617fc249b960cdea44857f44f1ef5598a299))
|
|
26
|
+
* remove type-fest ([487dd16](https://github.com/DarkSheepSoftware/eslint/commit/487dd1648e59c7227ba9c7fbb450313a9bf7bffc))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### ๐ฆ Dependencies
|
|
30
|
+
|
|
31
|
+
* **pkg:** update dependency @eslint/compat to v1.4.1 ([c694920](https://github.com/DarkSheepSoftware/eslint/commit/c6949209d002d81be4bd93d1bd53dfda3ba8cf98))
|
|
32
|
+
* **pkg:** update dependency @stylistic/eslint-plugin to v5.5.0 ([fbf655f](https://github.com/DarkSheepSoftware/eslint/commit/fbf655fff75821b8726937f380af1b579b9b51b6))
|
|
33
|
+
* **pkg:** update dependency eslint-plugin-jest to v29.1.0 ([1778492](https://github.com/DarkSheepSoftware/eslint/commit/177849296b64977bf0cae74fb761eb628ce382b9))
|
|
34
|
+
* **pkg:** update dependency eslint-plugin-jsdoc to v61.1.1 ([#1056](https://github.com/DarkSheepSoftware/eslint/issues/1056)) ([b668a82](https://github.com/DarkSheepSoftware/eslint/commit/b668a829b6a965702fc8d6d73baf968838c9ec1b))
|
|
35
|
+
* **pkg:** update dependency eslint-plugin-jsdoc to v61.1.12 ([c82fbe7](https://github.com/DarkSheepSoftware/eslint/commit/c82fbe71b2a9deecbf23f51fef55dbb9b4a9fbb9))
|
|
36
|
+
* **pkg:** update dependency eslint-plugin-package-json to v0.65.3 ([2ad7837](https://github.com/DarkSheepSoftware/eslint/commit/2ad7837bee90dfe5f184db796f5b64b92e455541))
|
|
37
|
+
* **pkg:** update dependency eslint-plugin-unicorn to v62 ([92c0d8b](https://github.com/DarkSheepSoftware/eslint/commit/92c0d8bf3824e03a4b523833d2503d68190e51ff))
|
|
38
|
+
* **pkg:** update dependency eslint-plugin-unused-imports to v4.3.0 ([685e657](https://github.com/DarkSheepSoftware/eslint/commit/685e6576c526efad91ab19b9bb672d2cbdc4468c))
|
|
39
|
+
* **pkg:** update eslint monorepo to v9.39.1 ([2f10f27](https://github.com/DarkSheepSoftware/eslint/commit/2f10f2730d39bdfbf146da471a7adced9e749b89))
|
|
40
|
+
* **pkg:** update typescript-eslint monorepo to v8.46.4 ([bf7051d](https://github.com/DarkSheepSoftware/eslint/commit/bf7051d052f54eb48e42a5af8612ce15d6e88f65))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### ๐งน Chores
|
|
44
|
+
|
|
45
|
+
* eslint . --fix ([66dac10](https://github.com/DarkSheepSoftware/eslint/commit/66dac101e57ff2f29e401a45a16e784779907947))
|
|
46
|
+
|
|
3
47
|
## [9.0.2](https://github.com/DarkSheepSoftware/eslint/compare/v9.0.1...v9.0.2) (2025-10-11)
|
|
4
48
|
|
|
5
49
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darksheep/eslint",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.1",
|
|
4
4
|
"description": "A fairly complete (opinionated) eslint config",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,36 +26,36 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@darksheep/environment": "3.2.0",
|
|
28
28
|
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
|
29
|
-
"@eslint/compat": "1.4.
|
|
30
|
-
"@eslint/js": "9.
|
|
31
|
-
"@stylistic/eslint-plugin": "5.
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "8.46.
|
|
33
|
-
"@typescript-eslint/parser": "8.46.
|
|
29
|
+
"@eslint/compat": "1.4.1",
|
|
30
|
+
"@eslint/js": "9.39.1",
|
|
31
|
+
"@stylistic/eslint-plugin": "5.5.0",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "8.46.4",
|
|
33
|
+
"@typescript-eslint/parser": "8.46.4",
|
|
34
34
|
"editorconfig": "3.0.1",
|
|
35
35
|
"eslint-plugin-command": "3.3.1",
|
|
36
|
-
"eslint-plugin-jest": "29.0
|
|
37
|
-
"eslint-plugin-jsdoc": "61.1.
|
|
36
|
+
"eslint-plugin-jest": "29.1.0",
|
|
37
|
+
"eslint-plugin-jsdoc": "61.1.12",
|
|
38
38
|
"eslint-plugin-jsonc": "2.21.0",
|
|
39
39
|
"eslint-plugin-n": "17.23.1",
|
|
40
|
-
"eslint-plugin-package-json": "0.
|
|
40
|
+
"eslint-plugin-package-json": "0.65.3",
|
|
41
41
|
"eslint-plugin-perfectionist": "4.15.1",
|
|
42
42
|
"eslint-plugin-promise": "7.2.1",
|
|
43
43
|
"eslint-plugin-react": "7.37.5",
|
|
44
44
|
"eslint-plugin-react-native": "5.0.0",
|
|
45
45
|
"eslint-plugin-regexp": "2.10.0",
|
|
46
46
|
"eslint-plugin-security": "3.0.1",
|
|
47
|
-
"eslint-plugin-unicorn": "
|
|
48
|
-
"eslint-plugin-unused-imports": "4.
|
|
47
|
+
"eslint-plugin-unicorn": "62.0.0",
|
|
48
|
+
"eslint-plugin-unused-imports": "4.3.0",
|
|
49
49
|
"eslint-plugin-yml": "1.19.0",
|
|
50
50
|
"jsonc-eslint-parser": "2.4.1",
|
|
51
51
|
"yaml-eslint-parser": "1.3.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@darksheep/eslint-formatter-github": "2.2.0",
|
|
55
|
+
"@darksheep/package.json": "~3.1.0",
|
|
55
56
|
"@eslint/config-inspector": "~1.3.0",
|
|
56
|
-
"@types/node": "~
|
|
57
|
-
"eslint": "~9.
|
|
58
|
-
"type-fest": "~5.0.0",
|
|
57
|
+
"@types/node": "~24.10.0",
|
|
58
|
+
"eslint": "~9.39.0",
|
|
59
59
|
"typescript": "~5.9.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependenciesMeta": {
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"optional": true
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
-
"packageManager": "yarn@4.
|
|
69
|
+
"packageManager": "yarn@4.11.0",
|
|
70
70
|
"engines": {
|
|
71
71
|
"node": "^20.13.1 || >=22.2.0"
|
|
72
72
|
},
|
|
73
73
|
"volta": {
|
|
74
|
-
"node": "
|
|
75
|
-
"yarn": "4.
|
|
74
|
+
"node": "24.11.0",
|
|
75
|
+
"yarn": "4.11.0"
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -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
|
}
|
|
@@ -19,7 +19,8 @@ const preferInstance = (context) => ({
|
|
|
19
19
|
const message = 'Use `instanceof Array` instead of `Array.isArray()`';
|
|
20
20
|
|
|
21
21
|
if (node.arguments.length !== 1) {
|
|
22
|
-
|
|
22
|
+
context.report({ node, message });
|
|
23
|
+
return;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
const left = context.sourceCode.getText(node.arguments[0]);
|
package/src/index.js
CHANGED
|
@@ -63,7 +63,7 @@ const configBuilders = [
|
|
|
63
63
|
*/
|
|
64
64
|
async function createConfigUrl(root) {
|
|
65
65
|
const configs = await Promise.all(
|
|
66
|
-
configBuilders.map((builder) => builder(root)),
|
|
66
|
+
configBuilders.map(async (builder) => await builder(root)),
|
|
67
67
|
);
|
|
68
68
|
|
|
69
69
|
return configs.flat();
|
|
@@ -75,7 +75,7 @@ async function createConfigUrl(root) {
|
|
|
75
75
|
*/
|
|
76
76
|
export async function createConfig(root) {
|
|
77
77
|
if (root instanceof URL) {
|
|
78
|
-
return createConfigUrl(root);
|
|
78
|
+
return await createConfigUrl(root);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
if (typeof root !== 'string') {
|
|
@@ -92,5 +92,5 @@ export async function createConfig(root) {
|
|
|
92
92
|
throw new Error('Cannot compute filepath');
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
return createConfigUrl(pathToFileURL(filepath));
|
|
95
|
+
return await createConfigUrl(pathToFileURL(filepath));
|
|
96
96
|
}
|
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',
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
* @import { URL } from 'node:url';
|
|
3
3
|
* @import { Linter } from 'eslint';
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
getCommonFiles,
|
|
7
|
+
getModuleFiles,
|
|
8
|
+
getTypescriptFiles,
|
|
9
|
+
} from '../utilities/eslint-files.js';
|
|
6
10
|
import { getPackageJson } from '../utilities/package.js';
|
|
7
11
|
|
|
8
12
|
/**
|
|
@@ -28,129 +32,141 @@ export async function createEslintTypescriptConfig(root) {
|
|
|
28
32
|
const typescriptParser = idef(await import('@typescript-eslint/parser'));
|
|
29
33
|
const typescriptPlugin = idef(await import('@typescript-eslint/eslint-plugin'));
|
|
30
34
|
|
|
31
|
-
return [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
+
},
|
|
40
50
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
'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',
|
|
66
75
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
// Rules that prevert some commmon ts issues
|
|
77
|
+
'no-var': 'error',
|
|
78
|
+
'prefer-rest-params': 'error',
|
|
79
|
+
'prefer-spread': 'error',
|
|
71
80
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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',
|
|
90
99
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
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
|
+
},
|
|
154
170
|
},
|
|
155
|
-
|
|
171
|
+
];
|
|
156
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',
|
|
@@ -6,7 +6,7 @@ const globEachRegex = /\{[\w\-.]+(?:,[\w\-.]+)*\}/u;
|
|
|
6
6
|
* @returns {string[]}
|
|
7
7
|
*/
|
|
8
8
|
export function expandGlob(input) {
|
|
9
|
-
const globNumMatch =
|
|
9
|
+
const globNumMatch = globNumRegex.exec(input);
|
|
10
10
|
if (typeof globNumMatch?.index === 'number') {
|
|
11
11
|
const first = input.slice(0, globNumMatch.index);
|
|
12
12
|
const each = globNumMatch[0];
|
|
@@ -28,7 +28,7 @@ export function expandGlob(input) {
|
|
|
28
28
|
return output.flatMap(expandGlob);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
const globEachMatch =
|
|
31
|
+
const globEachMatch = globEachRegex.exec(input);
|
|
32
32
|
if (typeof globEachMatch?.index === 'number') {
|
|
33
33
|
const first = input.slice(0, globEachMatch.index);
|
|
34
34
|
const each = globEachMatch[0];
|
|
@@ -109,7 +109,7 @@ export async function findInPaths(paths, filename) {
|
|
|
109
109
|
* @returns {Promise<string|null>} Returns absolute path to the closest {filename} if found.
|
|
110
110
|
*/
|
|
111
111
|
export async function findUp(rootFilePath, filename, stopDirectory = Path.resolve('/')) {
|
|
112
|
-
return findInPaths(
|
|
112
|
+
return await findInPaths(
|
|
113
113
|
await listParents(rootFilePath, stopDirectory),
|
|
114
114
|
filename,
|
|
115
115
|
);
|
package/src/utilities/package.js
CHANGED
package/types/eslint.config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const _default: (import("eslint").Linter.Config<import("eslint").
|
|
1
|
+
declare const _default: (import("eslint").Linter.Config<import(".store/@eslint-core-npm-0.17.0-8579df04c4/package", { with: { "resolution-mode": "require" } }).RulesConfig> | {
|
|
2
2
|
rules: {
|
|
3
3
|
'max-lines-per-function': number;
|
|
4
4
|
};
|
|
@@ -2,9 +2,8 @@ declare const _default: {
|
|
|
2
2
|
processors: {
|
|
3
3
|
logger: {
|
|
4
4
|
supportsAutofix: true;
|
|
5
|
-
postprocess: (messages:
|
|
5
|
+
postprocess: (messages: import(".store/@eslint-core-npm-0.17.0-8579df04c4/package", { with: { "resolution-mode": "require" } }).LintMessage[][], filename: string) => import(".store/@eslint-core-npm-0.17.0-8579df04c4/package", { with: { "resolution-mode": "require" } }).LintMessage[];
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
9
|
export default _default;
|
|
10
|
-
import type { Linter } from 'eslint';
|