Skip to content
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
37 changes: 37 additions & 0 deletions crates/oxc_transformer/src/env/options.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use oxc_diagnostics::Error;
use serde::Deserialize;
use serde_json::Value;

use super::targets::{query::Targets, Versions};

Expand All @@ -15,6 +16,42 @@ pub struct EnvOptions {

#[serde(default = "default_as_true")]
pub bugfixes: bool,

/// Unused.
pub spec: bool,

/// Unused.
pub loose: bool,

/// Unused.
pub modules: Option<Value>,

/// Unused.
pub debug: bool,

/// Unused.
pub include: Option<Value>,

/// Unused.
pub exclude: Option<Value>,

/// Unused.
pub use_built_ins: Option<Value>,

/// Unused.
pub corejs: Option<Value>,

/// Unused.
pub force_all_transforms: bool,

/// Unused.
pub config_path: Option<String>,

/// Unused.
pub ignore_browserslist_config: bool,

/// Unused.
pub shipped_proposals: bool,
}

impl EnvOptions {
Expand Down
4 changes: 4 additions & 0 deletions crates/oxc_transformer/src/typescript/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ pub struct TypeScriptOptions {
// When enabled, type-only class fields are only removed if they are prefixed with the declare modifier:
#[serde(default = "default_as_true")]
pub allow_declare_fields: bool,

/// Unused.
pub optimize_const_enums: bool,
}

impl TypeScriptOptions {
Expand Down Expand Up @@ -89,6 +92,7 @@ impl Default for TypeScriptOptions {
only_remove_type_imports: false,
allow_namespaces: default_as_true(),
allow_declare_fields: default_as_true(),
optimize_const_enums: false,
}
}
}
1 change: 1 addition & 0 deletions napi/transform/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ impl From<TypeScriptBindingOptions> for TypeScriptOptions {
.unwrap_or(ops.only_remove_type_imports),
allow_namespaces: options.allow_namespaces.unwrap_or(ops.allow_namespaces),
allow_declare_fields: options.allow_declare_fields.unwrap_or(ops.allow_declare_fields),
optimize_const_enums: false,
}
}
}
Expand Down
Loading