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
7 changes: 6 additions & 1 deletion crates/oxc_transformer/src/typescript/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ pub struct TypeScriptOptions {
#[serde(default = "default_as_true")]
pub allow_namespaces: bool,

// When enabled, type-only class fields are only removed if they are prefixed with the declare modifier:
/// When enabled, type-only class fields are only removed if they are prefixed with the declare modifier:
///
/// ## Deprecated
///
/// Allowing `declare` fields is built-in support in Oxc without any option. If you want to remove class fields
/// without initializer, you can use `remove_class_fields_without_initializer: true` instead.
#[serde(default = "default_as_true")]
pub allow_declare_fields: bool,

Expand Down
8 changes: 8 additions & 0 deletions napi/transform/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,14 @@ export interface TypeScriptOptions {
jsxPragmaFrag?: string
onlyRemoveTypeImports?: boolean
allowNamespaces?: boolean
/**
* When enabled, type-only class fields are only removed if they are prefixed with the declare modifier:
*
* @deprecated
*
* Allowing `declare` fields is built-in support in Oxc without any option. If you want to remove class fields
* without initializer, you can use `remove_class_fields_without_initializer: true` instead.
*/
allowDeclareFields?: boolean
/**
* When enabled, class fields without initializers are removed.
Expand Down
6 changes: 6 additions & 0 deletions napi/transform/src/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ pub struct TypeScriptOptions {
pub jsx_pragma_frag: Option<String>,
pub only_remove_type_imports: Option<bool>,
pub allow_namespaces: Option<bool>,
/// When enabled, type-only class fields are only removed if they are prefixed with the declare modifier:
///
/// @deprecated
///
/// Allowing `declare` fields is built-in support in Oxc without any option. If you want to remove class fields
/// without initializer, you can use `remove_class_fields_without_initializer: true` instead.
pub allow_declare_fields: Option<bool>,
/// When enabled, class fields without initializers are removed.
///
Expand Down
Loading