@@ -29,13 +29,14 @@ fn missing_catch_parameter_diagnostic(span: Span) -> OxcDiagnostic {
2929
3030#[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema ) ]
3131#[ schemars( rename_all = "camelCase" ) ]
32- #[ serde( rename_all = "camelCase" ) ]
33- struct ConfigElement0 {
32+ #[ serde( rename_all = "camelCase" , default ) ]
33+ struct PreserveCaughtErrorOptions {
34+ /// When set to `true`, requires that catch clauses always have a parameter.
3435 require_catch_parameter : bool ,
3536}
3637
3738#[ derive( Debug , Default , Clone , Serialize , Deserialize , JsonSchema ) ]
38- pub struct PreserveCaughtError ( ConfigElement0 ) ;
39+ pub struct PreserveCaughtError ( PreserveCaughtErrorOptions ) ;
3940
4041struct ThrowFinder < ' a , ' ctx > {
4142 catch_param : & ' a BindingPattern < ' a > ,
@@ -162,7 +163,7 @@ declare_oxc_lint!(
162163 eslint,
163164 suspicious,
164165 pending,
165- config = ConfigElement0 ,
166+ config = PreserveCaughtErrorOptions ,
166167) ;
167168impl PreserveCaughtError {
168169 fn check_try_statement < ' a > ( & self , try_stmt : & ' a TryStatement < ' a > , ctx : & LintContext < ' a > ) {
0 commit comments