Skip to content

Commit b07d29c

Browse files
committed
fix(linter/typescript/no-this-alias): update Default implementation for NoThisAliasConfig (#12789)
1 parent 0db34ab commit b07d29c

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

crates/oxc_linter/src/rules/typescript/no_this_alias.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn no_this_destructure_diagnostic(span: Span) -> OxcDiagnostic {
3131
#[derive(Debug, Default, Clone)]
3232
pub struct NoThisAlias(Box<NoThisAliasConfig>);
3333

34-
#[derive(Debug, Clone)]
34+
#[derive(Debug, Default, Clone)]
3535
pub struct NoThisAliasConfig {
3636
allow_destructuring: bool,
3737
allow_names: FxHashSet<CompactStr>,
@@ -45,11 +45,6 @@ impl std::ops::Deref for NoThisAlias {
4545
}
4646
}
4747

48-
impl Default for NoThisAliasConfig {
49-
fn default() -> Self {
50-
Self { allow_destructuring: true, allow_names: FxHashSet::default() }
51-
}
52-
}
5348
impl NoThisAlias {
5449
fn is_allowed(&self, name: &str) -> bool {
5550
self.allow_names.contains(name)

crates/oxc_linter/tests/rule_configuration_test.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ fn test_rule_default_matches_from_configuration_null() {
2424
// When fixing a rule, ensure that either:
2525
// 1. The Default implementation returns the same values as from_configuration(null), or
2626
// 2. The from_configuration method is updated to return Default::default() when given null
27-
let exceptions = [
28-
"typescript/no-this-alias",
29-
"unicorn/prefer-object-from-entries",
30-
"unicorn/prefer-structured-clone",
31-
];
27+
let exceptions = ["unicorn/prefer-object-from-entries", "unicorn/prefer-structured-clone"];
3228

3329
// Iterate through all available linter rules
3430
for rule in RULES.iter() {

0 commit comments

Comments
 (0)