diff --git a/crates/oxc_linter/src/rules/typescript/no_this_alias.rs b/crates/oxc_linter/src/rules/typescript/no_this_alias.rs index 5e7a18ab8ddce..5462f2faf8882 100644 --- a/crates/oxc_linter/src/rules/typescript/no_this_alias.rs +++ b/crates/oxc_linter/src/rules/typescript/no_this_alias.rs @@ -31,12 +31,18 @@ fn no_this_destructure_diagnostic(span: Span) -> OxcDiagnostic { #[derive(Debug, Default, Clone)] pub struct NoThisAlias(Box); -#[derive(Debug, Default, Clone)] +#[derive(Debug, Clone)] pub struct NoThisAliasConfig { allow_destructuring: bool, allow_names: FxHashSet, } +impl Default for NoThisAliasConfig { + fn default() -> Self { + Self { allow_destructuring: true, allow_names: FxHashSet::default() } + } +} + impl std::ops::Deref for NoThisAlias { type Target = NoThisAliasConfig; @@ -81,7 +87,7 @@ impl Rule for NoThisAlias { allow_destructuring: obj .and_then(|v| v.get("allowDestructuring")) .and_then(Value::as_bool) - .unwrap_or_default(), + .unwrap_or(true), allow_names: allowed_names, })) }