Skip to content

Commit 368112c

Browse files
committed
fix(ast): remove #[visit(ignore)] from ExportDefaultDeclarationKind's TSInterfaceDeclaration (#4497)
I can't find any reason to add `#[visit(ignore)]` there
1 parent f5f0ba8 commit 368112c

File tree

5 files changed

+22
-3
lines changed

5 files changed

+22
-3
lines changed

crates/oxc_ast/src/ast/js.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2312,7 +2312,6 @@ pub enum ExportDefaultDeclarationKind<'a> {
23122312
FunctionDeclaration(Box<'a, Function<'a>>) = 64,
23132313
ClassDeclaration(Box<'a, Class<'a>>) = 65,
23142314

2315-
#[visit(ignore)]
23162315
TSInterfaceDeclaration(Box<'a, TSInterfaceDeclaration<'a>>) = 66,
23172316

23182317
// `Expression` variants added here by `inherit_variants!` macro

crates/oxc_ast/src/generated/visit.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4154,10 +4154,12 @@ pub mod walk {
41544154
visitor.visit_function(it, flags)
41554155
}
41564156
ExportDefaultDeclarationKind::ClassDeclaration(it) => visitor.visit_class(it),
4157+
ExportDefaultDeclarationKind::TSInterfaceDeclaration(it) => {
4158+
visitor.visit_ts_interface_declaration(it)
4159+
}
41574160
match_expression!(ExportDefaultDeclarationKind) => {
41584161
visitor.visit_expression(it.to_expression())
41594162
}
4160-
_ => {}
41614163
}
41624164
}
41634165

crates/oxc_ast/src/generated/visit_mut.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4396,10 +4396,12 @@ pub mod walk_mut {
43964396
visitor.visit_function(it, flags)
43974397
}
43984398
ExportDefaultDeclarationKind::ClassDeclaration(it) => visitor.visit_class(it),
4399+
ExportDefaultDeclarationKind::TSInterfaceDeclaration(it) => {
4400+
visitor.visit_ts_interface_declaration(it)
4401+
}
43994402
match_expression!(ExportDefaultDeclarationKind) => {
44004403
visitor.visit_expression(it.to_expression_mut())
44014404
}
4402-
_ => {}
44034405
}
44044406
}
44054407

crates/oxc_linter/src/snapshots/consistent_type_definitions.snap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@ source: crates/oxc_linter/src/tester.rs
120120
╰────
121121
help: Use an `type` instead of a `interface`
122122

123+
typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface`
124+
╭─[consistent_type_definitions.tsx:2:19]
125+
1
126+
2export default interface Test {
127+
· ─────────
128+
3 │ bar(): string;
129+
╰────
130+
help: Use an `type` instead of a `interface`
131+
123132
typescript-eslint(consistent-type-definitions): Use an `interface` instead of a `type`
124133
╭─[consistent_type_definitions.tsx:2:19]
125134
1 │

crates/oxc_linter/src/snapshots/prefer_function_type.snap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ source: crates/oxc_linter/src/tester.rs
1515
╰────
1616
help: The function type form `() => string` is generally preferred when possible for being more succinct.
1717

18+
⚠ typescript-eslint(prefer-function-type): Enforce using function types instead of interfaces with call signatures.
19+
╭─[prefer_function_type.tsx:1:47]
20+
1 │ export default interface Foo { /** comment */ (): string; }
21+
· ───────────
22+
╰────
23+
help: The function type form `() => string` is generally preferred when possible for being more succinct.
24+
1825
⚠ typescript-eslint(prefer-function-type): Enforce using function types instead of interfaces with call signatures.
1926
╭─[prefer_function_type.tsx:4:11]
2027
3 │ // comment

0 commit comments

Comments
 (0)