mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor(transformer/class-properties)!: rename ClassPropertiesOptions::loose (#7716)
`loose` option also covers the `private_fields_as_properties` assumption, not only `set_public_class_fields`.
This commit is contained in:
parent
a6fd2def34
commit
59132006c9
1 changed files with 2 additions and 4 deletions
|
|
@ -168,8 +168,7 @@ type FxIndexMap<K, V> = IndexMap<K, V, FxBuildHasher>;
|
|||
#[derive(Debug, Default, Clone, Copy, Deserialize)]
|
||||
#[serde(default, rename_all = "camelCase")]
|
||||
pub struct ClassPropertiesOptions {
|
||||
#[serde(alias = "loose")]
|
||||
pub(crate) set_public_class_fields: bool,
|
||||
pub(crate) loose: bool,
|
||||
}
|
||||
|
||||
/// Class properties transform.
|
||||
|
|
@ -227,8 +226,7 @@ impl<'a, 'ctx> ClassProperties<'a, 'ctx> {
|
|||
ctx: &'ctx TransformCtx<'a>,
|
||||
) -> Self {
|
||||
// TODO: Raise error if these 2 options are inconsistent
|
||||
let set_public_class_fields =
|
||||
options.set_public_class_fields || ctx.assumptions.set_public_class_fields;
|
||||
let set_public_class_fields = options.loose || ctx.assumptions.set_public_class_fields;
|
||||
|
||||
Self {
|
||||
set_public_class_fields,
|
||||
|
|
|
|||
Loading…
Reference in a new issue