File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
crates/oxc_linter/src/rules/typescript Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -31,12 +31,18 @@ fn no_this_destructure_diagnostic(span: Span) -> OxcDiagnostic {
3131#[ derive( Debug , Default , Clone ) ]
3232pub struct NoThisAlias ( Box < NoThisAliasConfig > ) ;
3333
34- #[ derive( Debug , Default , Clone ) ]
34+ #[ derive( Debug , Clone ) ]
3535pub struct NoThisAliasConfig {
3636 allow_destructuring : bool ,
3737 allow_names : FxHashSet < CompactStr > ,
3838}
3939
40+ impl Default for NoThisAliasConfig {
41+ fn default ( ) -> Self {
42+ Self { allow_destructuring : true , allow_names : FxHashSet :: default ( ) }
43+ }
44+ }
45+
4046impl std:: ops:: Deref for NoThisAlias {
4147 type Target = NoThisAliasConfig ;
4248
@@ -81,7 +87,7 @@ impl Rule for NoThisAlias {
8187 allow_destructuring : obj
8288 . and_then ( |v| v. get ( "allowDestructuring" ) )
8389 . and_then ( Value :: as_bool)
84- . unwrap_or_default ( ) ,
90+ . unwrap_or ( true ) ,
8591 allow_names : allowed_names,
8692 } ) )
8793 }
You can’t perform that action at this time.
0 commit comments