Skip to content

Commit 0dd6dfd

Browse files
committed
fix(linter): patch @typescript-eslint/scope manager
1 parent 377e904 commit 0dd6dfd

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
diff --git a/dist/scope/ScopeBase.js b/dist/scope/ScopeBase.js
2+
index 5e07a7c3fb4670b2ce4fa405798d2f27c0084fef..b773c16431a860580dd9408c6127b06256c41c3b 100644
3+
--- a/dist/scope/ScopeBase.js
4+
+++ b/dist/scope/ScopeBase.js
5+
@@ -8,6 +8,7 @@ const ID_1 = require("../ID");
6+
const Reference_1 = require("../referencer/Reference");
7+
const variable_1 = require("../variable");
8+
const ScopeType_1 = require("./ScopeType");
9+
+const ImplicitLibVariable_1 = require("../variable/ImplicitLibVariable");
10+
/**
11+
* Test if scope is strict
12+
*/
13+
@@ -254,6 +255,10 @@ class ScopeBase {
14+
return false;
15+
}
16+
// variable exists on the scope
17+
+ // implicit lib variables should always be resolved statically
18+
+ if (variable instanceof ImplicitLibVariable_1.ImplicitLibVariable) {
19+
+ return true;
20+
+ }
21+
// in module mode, we can statically resolve everything, regardless of its decl type
22+
if (scopeManager.isModule()) {
23+
return true;
24+
@@ -306,6 +311,11 @@ class ScopeBase {
25+
set.set(name, variable);
26+
variables.push(variable);
27+
}
28+
+ else if (variable instanceof ImplicitLibVariable_1.ImplicitLibVariable &&
29+
+ nameOrVariable instanceof ImplicitLibVariable_1.ImplicitLibVariable) {
30+
+ variable.isTypeVariable ||= nameOrVariable.isTypeVariable;
31+
+ variable.isValueVariable ||= nameOrVariable.isValueVariable;
32+
+ }
33+
if (def) {
34+
variable.defs.push(def);
35+
this.addDeclaredVariablesOfNode(variable, def.node);
36+
diff --git a/dist/variable/ImplicitLibVariable.d.ts b/dist/variable/ImplicitLibVariable.d.ts
37+
index 6c967519e4bf1ce20c0fc5dd60e5bde2e3ae9ef2..2c4ef8ffb2aba72467d6e7679f042cffabdb03ab 100644
38+
--- a/dist/variable/ImplicitLibVariable.d.ts
39+
+++ b/dist/variable/ImplicitLibVariable.d.ts
40+
@@ -18,10 +18,10 @@ export declare class ImplicitLibVariable extends ESLintScopeVariable implements
41+
/**
42+
* `true` if the variable is valid in a type context, false otherwise
43+
*/
44+
- readonly isTypeVariable: boolean;
45+
+ isTypeVariable: boolean;
46+
/**
47+
* `true` if the variable is valid in a value context, false otherwise
48+
*/
49+
- readonly isValueVariable: boolean;
50+
+ isValueVariable: boolean;
51+
constructor(scope: Scope, name: string, { eslintImplicitGlobalSetting, isTypeVariable, isValueVariable, writeable, }: ImplicitLibVariableOptions);
52+
}

pnpm-lock.yaml

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,7 @@ onlyBuiltDependencies:
4141
- '@vscode/vsce-sign@2.0.8'
4242
- esbuild@0.25.11
4343

44+
patchedDependencies:
45+
'@typescript-eslint/scope-manager': patches/@typescript-eslint__scope-manager.patch
46+
4447
verifyDepsBeforeRun: install

0 commit comments

Comments
 (0)