diff --git a/crates/oxc_transformer/src/typescript/options.rs b/crates/oxc_transformer/src/typescript/options.rs index 0d2688ccdadc9..8f562c52af648 100644 --- a/crates/oxc_transformer/src/typescript/options.rs +++ b/crates/oxc_transformer/src/typescript/options.rs @@ -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, diff --git a/napi/transform/index.d.ts b/napi/transform/index.d.ts index 21280de4c7eb7..d04d6df0a5f59 100644 --- a/napi/transform/index.d.ts +++ b/napi/transform/index.d.ts @@ -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. diff --git a/napi/transform/src/transformer.rs b/napi/transform/src/transformer.rs index 62ffdca237c1c..03b9dbe1ba6cf 100644 --- a/napi/transform/src/transformer.rs +++ b/napi/transform/src/transformer.rs @@ -258,6 +258,12 @@ pub struct TypeScriptOptions { pub jsx_pragma_frag: Option, pub only_remove_type_imports: Option, pub allow_namespaces: Option, + /// 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, /// When enabled, class fields without initializers are removed. ///