diff --git a/crates/oxc_transformer/src/es2015/arrow_functions.rs b/crates/oxc_transformer/src/es2015/arrow_functions.rs index 186a34387a374..b8e185d0ae311 100644 --- a/crates/oxc_transformer/src/es2015/arrow_functions.rs +++ b/crates/oxc_transformer/src/es2015/arrow_functions.rs @@ -129,12 +129,10 @@ use oxc_syntax::{ scope::{ScopeFlags, ScopeId}, symbol::SymbolFlags, }; -use oxc_traverse::{Ancestor, Traverse, TraverseCtx}; +use oxc_traverse::{Ancestor, BoundIdentifier, Traverse, TraverseCtx}; use serde::Deserialize; -use crate::helpers::bindings::BoundIdentifier; - #[derive(Debug, Default, Clone, Deserialize)] pub struct ArrowFunctionsOptions { /// This option enables the following: diff --git a/crates/oxc_transformer/src/es2021/logical_assignment_operators.rs b/crates/oxc_transformer/src/es2021/logical_assignment_operators.rs index 961cdd20d590c..07215bedde2b7 100644 --- a/crates/oxc_transformer/src/es2021/logical_assignment_operators.rs +++ b/crates/oxc_transformer/src/es2021/logical_assignment_operators.rs @@ -58,9 +58,9 @@ use oxc_ast::ast::*; use oxc_semantic::{ReferenceFlags, SymbolFlags}; use oxc_span::SPAN; use oxc_syntax::operator::{AssignmentOperator, LogicalOperator}; -use oxc_traverse::{Traverse, TraverseCtx}; +use oxc_traverse::{BoundIdentifier, Traverse, TraverseCtx}; -use crate::{helpers::bindings::BoundIdentifier, TransformCtx}; +use crate::TransformCtx; pub struct LogicalAssignmentOperators<'a, 'ctx> { ctx: &'ctx TransformCtx<'a>, diff --git a/crates/oxc_transformer/src/lib.rs b/crates/oxc_transformer/src/lib.rs index d1f7d55e5453c..a9f502ebb47af 100644 --- a/crates/oxc_transformer/src/lib.rs +++ b/crates/oxc_transformer/src/lib.rs @@ -29,10 +29,6 @@ mod typescript; mod plugins; -mod helpers { - pub mod bindings; -} - use std::path::Path; use common::Common; diff --git a/crates/oxc_transformer/src/react/jsx.rs b/crates/oxc_transformer/src/react/jsx.rs index 9447a9fb4cdb7..c48b952f76148 100644 --- a/crates/oxc_transformer/src/react/jsx.rs +++ b/crates/oxc_transformer/src/react/jsx.rs @@ -97,7 +97,9 @@ use oxc_syntax::{ symbol::SymbolFlags, xml_entities::XML_ENTITIES, }; -use oxc_traverse::{Traverse, TraverseCtx}; +use oxc_traverse::{BoundIdentifier, Traverse, TraverseCtx}; + +use crate::{common::module_imports::NamedImport, TransformCtx}; use super::diagnostics; pub use super::{ @@ -105,9 +107,6 @@ pub use super::{ jsx_source::ReactJsxSource, options::{JsxOptions, JsxRuntime}, }; -use crate::{ - common::module_imports::NamedImport, helpers::bindings::BoundIdentifier, TransformCtx, -}; pub struct ReactJsx<'a, 'ctx> { options: JsxOptions, diff --git a/crates/oxc_transformer/src/react/jsx_source.rs b/crates/oxc_transformer/src/react/jsx_source.rs index 97538a71b224f..7bb84e5d6311b 100644 --- a/crates/oxc_transformer/src/react/jsx_source.rs +++ b/crates/oxc_transformer/src/react/jsx_source.rs @@ -37,11 +37,12 @@ use oxc_ast::{ast::*, NONE}; use oxc_diagnostics::OxcDiagnostic; use oxc_span::{Span, SPAN}; use oxc_syntax::{number::NumberBase, symbol::SymbolFlags}; -use oxc_traverse::{Traverse, TraverseCtx}; +use oxc_traverse::{BoundIdentifier, Traverse, TraverseCtx}; use ropey::Rope; +use crate::TransformCtx; + use super::utils::get_line_column; -use crate::{helpers::bindings::BoundIdentifier, TransformCtx}; const SOURCE: &str = "__source"; const FILE_NAME_VAR: &str = "jsxFileName"; diff --git a/crates/oxc_transformer/src/helpers/bindings.rs b/crates/oxc_traverse/src/context/bound_identifier.rs similarity index 99% rename from crates/oxc_transformer/src/helpers/bindings.rs rename to crates/oxc_traverse/src/context/bound_identifier.rs index edbca55dc795f..a5155b459187f 100644 --- a/crates/oxc_transformer/src/helpers/bindings.rs +++ b/crates/oxc_traverse/src/context/bound_identifier.rs @@ -5,7 +5,8 @@ use oxc_syntax::{ scope::ScopeId, symbol::{SymbolFlags, SymbolId}, }; -use oxc_traverse::TraverseCtx; + +use crate::TraverseCtx; /// Info about a binding, from which one can create a `BindingIdentifier` or `IdentifierReference`s. /// diff --git a/crates/oxc_traverse/src/context/mod.rs b/crates/oxc_traverse/src/context/mod.rs index 55789487f4142..562bbc7da7eff 100644 --- a/crates/oxc_traverse/src/context/mod.rs +++ b/crates/oxc_traverse/src/context/mod.rs @@ -12,10 +12,13 @@ use oxc_syntax::{ }; use crate::ancestor::{Ancestor, AncestorType}; + mod ancestry; mod ast_operations; +mod bound_identifier; use ancestry::PopToken; pub use ancestry::TraverseAncestry; +pub use bound_identifier::BoundIdentifier; mod identifier; mod scoping; pub use scoping::TraverseScoping; diff --git a/crates/oxc_traverse/src/lib.rs b/crates/oxc_traverse/src/lib.rs index 57e300bb1f2d6..209fe2ac80c81 100644 --- a/crates/oxc_traverse/src/lib.rs +++ b/crates/oxc_traverse/src/lib.rs @@ -65,7 +65,7 @@ use oxc_ast::ast::Program; use oxc_semantic::{ScopeTree, SymbolTable}; mod context; -pub use context::{TraverseAncestry, TraverseCtx, TraverseScoping}; +pub use context::{BoundIdentifier, TraverseAncestry, TraverseCtx, TraverseScoping}; mod generated { pub mod ancestor;