@typescript-eslint/eslint-plugin 8.73.1-alpha.2 → 8.73.1-alpha.3
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/dist/util/scopeUtils.js +11 -3
- package/package.json +8 -8
package/dist/util/scopeUtils.js
CHANGED
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isReferenceToGlobalFunction = isReferenceToGlobalFunction;
|
|
4
4
|
function isReferenceToGlobalFunction(calleeName, node, sourceCode) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
// The reference is not always in the scope of the node. For example, a
|
|
6
|
+
// `switch` discriminant belongs to the switch scope but is referenced from
|
|
7
|
+
// the scope that contains the `switch`.
|
|
8
|
+
let ref;
|
|
9
|
+
let scope = sourceCode.getScope(node);
|
|
10
|
+
while (scope && !ref) {
|
|
11
|
+
ref = scope.references.find(ref => ref.identifier.name === calleeName &&
|
|
12
|
+
ref.identifier.range[0] >= node.range[0] &&
|
|
13
|
+
ref.identifier.range[1] <= node.range[1]);
|
|
14
|
+
scope = scope.upper;
|
|
15
|
+
}
|
|
8
16
|
// ensure it's the "global" version
|
|
9
17
|
return !ref?.resolved?.defs.length;
|
|
10
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typescript-eslint/eslint-plugin",
|
|
3
|
-
"version": "8.73.1-alpha.
|
|
3
|
+
"version": "8.73.1-alpha.3",
|
|
4
4
|
"description": "TypeScript plugin for ESLint",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@eslint-community/regexpp": "^4.12.2",
|
|
50
|
-
"@typescript-eslint/scope-manager": "8.73.1-alpha.
|
|
51
|
-
"@typescript-eslint/type-utils": "8.73.1-alpha.
|
|
52
|
-
"@typescript-eslint/utils": "8.73.1-alpha.
|
|
53
|
-
"@typescript-eslint/visitor-keys": "8.73.1-alpha.
|
|
50
|
+
"@typescript-eslint/scope-manager": "8.73.1-alpha.3",
|
|
51
|
+
"@typescript-eslint/type-utils": "8.73.1-alpha.3",
|
|
52
|
+
"@typescript-eslint/utils": "8.73.1-alpha.3",
|
|
53
|
+
"@typescript-eslint/visitor-keys": "8.73.1-alpha.3",
|
|
54
54
|
"ignore": "^7.0.5",
|
|
55
55
|
"natural-compare": "^1.4.0",
|
|
56
56
|
"ts-api-utils": "^2.5.0"
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@types/mdast": "^4.0.4",
|
|
61
61
|
"@types/natural-compare": "^1.4.3",
|
|
62
62
|
"@types/react": "^18.3.21",
|
|
63
|
-
"@typescript-eslint/rule-schema-to-typescript-types": "8.73.1-alpha.
|
|
64
|
-
"@typescript-eslint/rule-tester": "8.73.1-alpha.
|
|
63
|
+
"@typescript-eslint/rule-schema-to-typescript-types": "8.73.1-alpha.3",
|
|
64
|
+
"@typescript-eslint/rule-tester": "8.73.1-alpha.3",
|
|
65
65
|
"@typescript/native": "npm:typescript@7.1.0-dev.20261009.1",
|
|
66
66
|
"@vitest/coverage-v8": "^5.0.3",
|
|
67
67
|
"ajv": "^6.12.6",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"vitest": "^5.0.3"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"@typescript-eslint/parser": "^8.73.1-alpha.
|
|
84
|
+
"@typescript-eslint/parser": "^8.73.1-alpha.3",
|
|
85
85
|
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
|
86
86
|
"typescript": ">=4.8.4 <6.1.0"
|
|
87
87
|
},
|