Skip to content
Merged
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
10 changes: 8 additions & 2 deletions crates/oxc_linter/src/rules/typescript/no_this_alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@ fn no_this_destructure_diagnostic(span: Span) -> OxcDiagnostic {
#[derive(Debug, Default, Clone)]
pub struct NoThisAlias(Box<NoThisAliasConfig>);

#[derive(Debug, Default, Clone)]
#[derive(Debug, Clone)]
pub struct NoThisAliasConfig {
allow_destructuring: bool,
allow_names: FxHashSet<CompactStr>,
}

impl Default for NoThisAliasConfig {
fn default() -> Self {
Self { allow_destructuring: true, allow_names: FxHashSet::default() }
}
}

impl std::ops::Deref for NoThisAlias {
type Target = NoThisAliasConfig;

Expand Down Expand Up @@ -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,
}))
}
Expand Down
Loading