File tree Expand file tree Collapse file tree 1 file changed +5
-17
lines changed
crates/oxc_linter/src/rules/jest Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use oxc_macros::declare_oxc_lint;
44use oxc_semantic:: ScopeId ;
55use oxc_span:: Span ;
66use rustc_hash:: FxHashMap ;
7+ use schemars:: JsonSchema ;
78
89use crate :: {
910 context:: LintContext ,
@@ -34,8 +35,10 @@ fn unexpected_hook(span: Span) -> OxcDiagnostic {
3435 . with_label ( span)
3536}
3637
37- #[ derive( Debug , Clone ) ]
38+ #[ derive( Debug , Clone , JsonSchema ) ]
39+ #[ serde( rename_all = "camelCase" , default ) ]
3840pub struct RequireTopLevelDescribe {
41+ /// The maximum number of top-level `describe` blocks allowed in a test file.
3942 pub max_number_of_top_level_describes : usize ,
4043}
4144
@@ -96,25 +99,10 @@ declare_oxc_lint!(
9699 /// });
97100 /// });
98101 /// ```
99- ///
100- /// ### Options
101- ///
102- /// You can also enforce a limit on the number of describes allowed at the top-level
103- /// using the `maxNumberOfTopLevelDescribes` option:
104- ///
105- /// ```json
106- /// {
107- /// "jest/require-top-level-describe": [
108- /// "error",
109- /// {
110- /// "maxNumberOfTopLevelDescribes": 2
111- /// }
112- /// ]
113- /// }
114- /// ```
115102 RequireTopLevelDescribe ,
116103 jest,
117104 style,
105+ config = RequireTopLevelDescribe
118106) ;
119107
120108impl Rule for RequireTopLevelDescribe {
You can’t perform that action at this time.
0 commit comments