Skip to content

Commit 4c014f7

Browse files
committed
refactor: use oxc-parser instead of @typescript-eslint/parser
1 parent 9b29b74 commit 4c014f7

File tree

10 files changed

+528
-414
lines changed

10 files changed

+528
-414
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@
9999
"@nuxt/kit": "^3.16.2",
100100
"@nuxt/schema": "^3.16.2",
101101
"@typescript-eslint/scope-manager": "^8.30.1",
102-
"@typescript-eslint/typescript-estree": "^8.30.1",
103102
"@vue-macros/common": "3.0.0-beta.8",
103+
"estree-walker": "^3.0.3",
104+
"oxc-parser": "^0.64.0",
104105
"ts-macro": "^0.1.25",
105106
"unplugin": "^2.3.2"
106107
},
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/dist/scope/FunctionScope.js b/dist/scope/FunctionScope.js
2+
index f5eb4d90f48e71fa147b0ca31194313beb4c8a12..0957b146d5744624a025217c319a40f1a3ded25e 100644
3+
--- a/dist/scope/FunctionScope.js
4+
+++ b/dist/scope/FunctionScope.js
5+
@@ -24,11 +24,11 @@ class FunctionScope extends ScopeBase_1.ScopeBase {
6+
if (this.block.type === types_1.AST_NODE_TYPES.Program) {
7+
return true;
8+
}
9+
- const bodyStart = this.block.body?.range[0] ?? -1;
10+
+ const bodyStart = this.block.body?.start ?? this.block.body?.range[0] ?? -1;
11+
// It's invalid resolution in the following case:
12+
return !((variable.scope === this &&
13+
- ref.identifier.range[0] < bodyStart && // the reference is in the parameter part.
14+
- variable.defs.every(d => d.name.range[0] >= bodyStart)) // the variable is in the body.
15+
+ (ref.identifier.start ?? ref.identifier.range[0]) < bodyStart && // the reference is in the parameter part.
16+
+ variable.defs.every(d => (d.name.start ?? d.name.range[0]) >= bodyStart)) // the variable is in the body.
17+
);
18+
}
19+
}

0 commit comments

Comments
 (0)