@typescript-eslint/eslint-plugin 8.45.1-alpha.7 → 8.45.1-alpha.9
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.
@@ -149,6 +149,9 @@ exports.default = (0, util_1.createRule)({
|
|
149
149
|
case utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration:
|
150
150
|
case utils_1.AST_NODE_TYPES.TSTypeParameter:
|
151
151
|
return true;
|
152
|
+
// treat `export import Bar = Foo;` (and `import Foo = require('...')`) as declarations
|
153
|
+
case utils_1.AST_NODE_TYPES.TSImportEqualsDeclaration:
|
154
|
+
return parent.id === node;
|
152
155
|
default:
|
153
156
|
return false;
|
154
157
|
}
|
@@ -9,6 +9,7 @@ export type Options = [
|
|
9
9
|
destructuredArrayIgnorePattern?: string;
|
10
10
|
ignoreClassWithStaticInitBlock?: boolean;
|
11
11
|
ignoreRestSiblings?: boolean;
|
12
|
+
ignoreUsingDeclarations?: boolean;
|
12
13
|
reportUsedIgnorePattern?: boolean;
|
13
14
|
vars?: 'all' | 'local';
|
14
15
|
varsIgnorePattern?: string;
|
@@ -60,6 +60,10 @@ exports.default = (0, util_1.createRule)({
|
|
60
60
|
type: 'boolean',
|
61
61
|
description: 'Whether to ignore sibling properties in `...` destructurings.',
|
62
62
|
},
|
63
|
+
ignoreUsingDeclarations: {
|
64
|
+
type: 'boolean',
|
65
|
+
description: 'Whether to ignore using or await using declarations.',
|
66
|
+
},
|
63
67
|
reportUsedIgnorePattern: {
|
64
68
|
type: 'boolean',
|
65
69
|
description: 'Whether to report variables that match any of the valid ignore pattern options if they have been used.',
|
@@ -88,6 +92,7 @@ exports.default = (0, util_1.createRule)({
|
|
88
92
|
caughtErrors: 'all',
|
89
93
|
ignoreClassWithStaticInitBlock: false,
|
90
94
|
ignoreRestSiblings: false,
|
95
|
+
ignoreUsingDeclarations: false,
|
91
96
|
reportUsedIgnorePattern: false,
|
92
97
|
vars: 'all',
|
93
98
|
};
|
@@ -99,6 +104,9 @@ exports.default = (0, util_1.createRule)({
|
|
99
104
|
options.args = firstOption.args ?? options.args;
|
100
105
|
options.ignoreRestSiblings =
|
101
106
|
firstOption.ignoreRestSiblings ?? options.ignoreRestSiblings;
|
107
|
+
options.ignoreUsingDeclarations =
|
108
|
+
firstOption.ignoreUsingDeclarations ??
|
109
|
+
options.ignoreUsingDeclarations;
|
102
110
|
options.caughtErrors = firstOption.caughtErrors ?? options.caughtErrors;
|
103
111
|
options.ignoreClassWithStaticInitBlock =
|
104
112
|
firstOption.ignoreClassWithStaticInitBlock ??
|
@@ -382,6 +390,11 @@ exports.default = (0, util_1.createRule)({
|
|
382
390
|
}
|
383
391
|
continue;
|
384
392
|
}
|
393
|
+
if (def.type === utils_1.TSESLint.Scope.DefinitionType.Variable &&
|
394
|
+
options.ignoreUsingDeclarations &&
|
395
|
+
(def.parent.kind === 'await using' || def.parent.kind === 'using')) {
|
396
|
+
continue;
|
397
|
+
}
|
385
398
|
if (hasRestSpreadSibling(variable)) {
|
386
399
|
continue;
|
387
400
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@typescript-eslint/eslint-plugin",
|
3
|
-
"version": "8.45.1-alpha.
|
3
|
+
"version": "8.45.1-alpha.9",
|
4
4
|
"description": "TypeScript plugin for ESLint",
|
5
5
|
"files": [
|
6
6
|
"dist",
|
@@ -59,10 +59,10 @@
|
|
59
59
|
},
|
60
60
|
"dependencies": {
|
61
61
|
"@eslint-community/regexpp": "^4.10.0",
|
62
|
-
"@typescript-eslint/scope-manager": "8.45.1-alpha.
|
63
|
-
"@typescript-eslint/type-utils": "8.45.1-alpha.
|
64
|
-
"@typescript-eslint/utils": "8.45.1-alpha.
|
65
|
-
"@typescript-eslint/visitor-keys": "8.45.1-alpha.
|
62
|
+
"@typescript-eslint/scope-manager": "8.45.1-alpha.9",
|
63
|
+
"@typescript-eslint/type-utils": "8.45.1-alpha.9",
|
64
|
+
"@typescript-eslint/utils": "8.45.1-alpha.9",
|
65
|
+
"@typescript-eslint/visitor-keys": "8.45.1-alpha.9",
|
66
66
|
"graphemer": "^1.4.0",
|
67
67
|
"ignore": "^7.0.0",
|
68
68
|
"natural-compare": "^1.4.0",
|
@@ -71,8 +71,8 @@
|
|
71
71
|
"devDependencies": {
|
72
72
|
"@types/mdast": "^4.0.3",
|
73
73
|
"@types/natural-compare": "*",
|
74
|
-
"@typescript-eslint/rule-schema-to-typescript-types": "8.45.1-alpha.
|
75
|
-
"@typescript-eslint/rule-tester": "8.45.1-alpha.
|
74
|
+
"@typescript-eslint/rule-schema-to-typescript-types": "8.45.1-alpha.9",
|
75
|
+
"@typescript-eslint/rule-tester": "8.45.1-alpha.9",
|
76
76
|
"@vitest/coverage-v8": "^3.1.3",
|
77
77
|
"ajv": "^6.12.6",
|
78
78
|
"cross-fetch": "*",
|
@@ -92,7 +92,7 @@
|
|
92
92
|
"vitest": "^3.1.3"
|
93
93
|
},
|
94
94
|
"peerDependencies": {
|
95
|
-
"@typescript-eslint/parser": "^8.45.1-alpha.
|
95
|
+
"@typescript-eslint/parser": "^8.45.1-alpha.9",
|
96
96
|
"eslint": "^8.57.0 || ^9.0.0",
|
97
97
|
"typescript": ">=4.8.4 <6.0.0"
|
98
98
|
},
|