File tree Expand file tree Collapse file tree
crates/oxc_linter/src/rules/eslint Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,11 @@ impl Rule for NoUndef {
5050 for reference_id_list in ctx. scopes ( ) . root_unresolved_references_ids ( ) {
5151 for reference_id in reference_id_list {
5252 let reference = symbol_table. get_reference ( reference_id) ;
53+
54+ if reference. is_type ( ) {
55+ return ;
56+ }
57+
5358 let name = ctx. semantic ( ) . reference_name ( reference) ;
5459
5560 if ctx. env_contains_var ( name) {
@@ -153,7 +158,9 @@ fn test() {
153158 "class C { static { function a() {} a; } }" ,
154159 "class C { static { a; function a() {} } }" ,
155160 "String;Array;Boolean;" ,
156- "function resolve<T>(path: string): T { return { path } as T; }"
161+ "function resolve<T>(path: string): T { return { path } as T; }" ,
162+ "let xyz: NodeListOf<HTMLElement>" ,
163+ "type Foo = Record<string, unknown>;"
157164 ] ;
158165
159166 let fail = vec ! [
You can’t perform that action at this time.
0 commit comments