File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
crates/oxc_linter/src/rules/jest Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use oxc_ast::{AstKind, ast::Expression};
22use oxc_diagnostics:: OxcDiagnostic ;
33use oxc_macros:: declare_oxc_lint;
44use oxc_span:: { CompactStr , GetSpan , Span } ;
5+ use schemars:: JsonSchema ;
56
67use crate :: {
78 context:: LintContext ,
@@ -16,8 +17,10 @@ fn unexpected_hook_diagonsitc(span: Span) -> OxcDiagnostic {
1617#[ derive( Debug , Default , Clone ) ]
1718pub struct NoHooks ( Box < NoHooksConfig > ) ;
1819
19- #[ derive( Debug , Default , Clone ) ]
20+ #[ derive( Debug , Default , Clone , JsonSchema ) ]
21+ #[ serde( rename_all = "camelCase" , default ) ]
2022pub struct NoHooksConfig {
23+ /// An array of hook function names that are permitted for use.
2124 allow : Vec < CompactStr > ,
2225}
2326
@@ -81,6 +84,7 @@ declare_oxc_lint!(
8184 NoHooks ,
8285 jest,
8386 style,
87+ config = NoHooksConfig ,
8488) ;
8589
8690impl Rule for NoHooks {
You can’t perform that action at this time.
0 commit comments