Struct swc_ecma_transforms_typescript::strip::Config[][src]

pub struct Config {
    pub import_not_used_as_values: ImportsNotUsedAsValues,
    pub use_define_for_class_fields: bool,
    pub no_empty_export: bool,
}

Fields

import_not_used_as_values: ImportsNotUsedAsValuesuse_define_for_class_fields: bool

Align the semantics of TS class fields with TC39 class fields. Defaults to false.

See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#the-usedefineforclassfields-flag-and-the-declare-property-modifier.

When running tsc with configuration "target": "ESNext", "useDefineForClassFields": true, TS class fields are preserved as JS class fields. We target ESNext, so this our behavior with use_define_for_class_fields: true.

When running tsc with configuration "target": "<ES6-ES2020>", "useDefineForClassFields": true, TS class fields are transformed to Object.defineProperty() statements. You must additionally apply the swc_ecmascript::transforms::compat::es2020::class_properties() pass to get this backward-compatible output.

no_empty_export: bool

Don’t create export {}. By default, strip creates export {} for modules to preserve module context.

https://github.com/swc-project/swc/issues/1698

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.