Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ast): remove #[visit(ignore)] from ExportDefaultDeclarationKind's TSInterfaceDeclaration #4497

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion crates/oxc_ast/src/ast/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2312,7 +2312,6 @@ pub enum ExportDefaultDeclarationKind<'a> {
FunctionDeclaration(Box<'a, Function<'a>>) = 64,
ClassDeclaration(Box<'a, Class<'a>>) = 65,

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

// `Expression` variants added here by `inherit_variants!` macro
Expand Down
4 changes: 3 additions & 1 deletion crates/oxc_ast/src/generated/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4154,10 +4154,12 @@ pub mod walk {
visitor.visit_function(it, flags)
}
ExportDefaultDeclarationKind::ClassDeclaration(it) => visitor.visit_class(it),
ExportDefaultDeclarationKind::TSInterfaceDeclaration(it) => {
visitor.visit_ts_interface_declaration(it)
}
match_expression!(ExportDefaultDeclarationKind) => {
visitor.visit_expression(it.to_expression())
}
_ => {}
}
}

Expand Down
4 changes: 3 additions & 1 deletion crates/oxc_ast/src/generated/visit_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4396,10 +4396,12 @@ pub mod walk_mut {
visitor.visit_function(it, flags)
}
ExportDefaultDeclarationKind::ClassDeclaration(it) => visitor.visit_class(it),
ExportDefaultDeclarationKind::TSInterfaceDeclaration(it) => {
visitor.visit_ts_interface_declaration(it)
}
match_expression!(ExportDefaultDeclarationKind) => {
visitor.visit_expression(it.to_expression_mut())
}
_ => {}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ source: crates/oxc_linter/src/tester.rs
╰────
help: Use an `type` instead of a `interface`

⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface`
╭─[consistent_type_definitions.tsx:2:19]
1 │
2 │ export default interface Test {
· ─────────
3 │ bar(): string;
╰────
help: Use an `type` instead of a `interface`

⚠ typescript-eslint(consistent-type-definitions): Use an `interface` instead of a `type`
╭─[consistent_type_definitions.tsx:2:19]
1 │
Expand Down
7 changes: 7 additions & 0 deletions crates/oxc_linter/src/snapshots/prefer_function_type.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ source: crates/oxc_linter/src/tester.rs
╰────
help: The function type form `() => string` is generally preferred when possible for being more succinct.

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

⚠ typescript-eslint(prefer-function-type): Enforce using function types instead of interfaces with call signatures.
╭─[prefer_function_type.tsx:4:11]
3 │ // comment
Expand Down
Loading