diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index 3a1e4acf6..fb8bfeb99 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -12,8 +12,7 @@ use oxc_syntax::{ #[cfg(feature = "serde")] use serde::Serialize; -#[allow(clippy::wildcard_imports)] -use crate::ast::*; +use super::{jsx::*, literal::*, ts::*}; #[cfg_attr( all(feature = "serde", feature = "wasm"), diff --git a/crates/oxc_ast/src/ast/jsdoc.rs b/crates/oxc_ast/src/ast/jsdoc.rs deleted file mode 100644 index 9e658c1f6..000000000 --- a/crates/oxc_ast/src/ast/jsdoc.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! [`JSDoc`](https://github.com/microsoft/TypeScript/blob/54a554d8af2657630307cbfa8a3e4f3946e36507/src/compiler/types.ts#L393) - -use oxc_span::Span; -#[cfg(feature = "serde")] -use serde::Serialize; - -use crate::ast::TSType; - -#[derive(Debug, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))] -#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))] -pub struct JSDocNullableType<'a> { - #[cfg_attr(feature = "serde", serde(flatten))] - pub span: Span, - pub type_annotation: TSType<'a>, - pub postfix: bool, -} - -#[derive(Debug, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))] -#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))] -pub struct JSDocUnknownType { - #[cfg_attr(feature = "serde", serde(flatten))] - pub span: Span, -} diff --git a/crates/oxc_ast/src/ast/jsx.rs b/crates/oxc_ast/src/ast/jsx.rs index 9f27c3b12..f81fb83de 100644 --- a/crates/oxc_ast/src/ast/jsx.rs +++ b/crates/oxc_ast/src/ast/jsx.rs @@ -5,8 +5,7 @@ use oxc_span::{Atom, Span}; #[cfg(feature = "serde")] use serde::Serialize; -#[allow(clippy::wildcard_imports)] -use crate::ast::*; +use super::{js::*, literal::*, ts::*}; // 1.2 JSX Elements diff --git a/crates/oxc_ast/src/ast/mod.rs b/crates/oxc_ast/src/ast/mod.rs index 37e3f23f6..04cf0bc40 100644 --- a/crates/oxc_ast/src/ast/mod.rs +++ b/crates/oxc_ast/src/ast/mod.rs @@ -1,9 +1,8 @@ //! AST Definitions mod js; -mod jsdoc; mod jsx; mod literal; mod ts; -pub use self::{js::*, jsdoc::*, jsx::*, literal::*, ts::*}; +pub use self::{js::*, jsx::*, literal::*, ts::*}; diff --git a/crates/oxc_ast/src/ast/ts.rs b/crates/oxc_ast/src/ast/ts.rs index 62bf67b86..27dfbc9f7 100644 --- a/crates/oxc_ast/src/ast/ts.rs +++ b/crates/oxc_ast/src/ast/ts.rs @@ -8,8 +8,7 @@ use oxc_span::{Atom, GetSpan, Span}; #[cfg(feature = "serde")] use serde::Serialize; -#[allow(clippy::wildcard_imports)] -use crate::ast::*; +use super::{js::*, literal::*}; #[derive(Debug, Hash)] #[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))] @@ -1058,3 +1057,23 @@ impl ImportOrExportKind { matches!(self, Self::Type) } } + +// [`JSDoc`](https://github.com/microsoft/TypeScript/blob/54a554d8af2657630307cbfa8a3e4f3946e36507/src/compiler/types.ts#L393) + +#[derive(Debug, Hash)] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))] +#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))] +pub struct JSDocNullableType<'a> { + #[cfg_attr(feature = "serde", serde(flatten))] + pub span: Span, + pub type_annotation: TSType<'a>, + pub postfix: bool, +} + +#[derive(Debug, Hash)] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))] +#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))] +pub struct JSDocUnknownType { + #[cfg_attr(feature = "serde", serde(flatten))] + pub span: Span, +}