Skip to content

Commit 2fe606d

Browse files
committed
docs(linter): Add configuration option docs for jest/require-top-level-describe rule.
These already existed, but this ensures they're done via the documentation auto-generation tooling.
1 parent b9919bb commit 2fe606d

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

crates/oxc_linter/src/rules/jest/require_top_level_describe.rs

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use oxc_macros::declare_oxc_lint;
44
use oxc_semantic::ScopeId;
55
use oxc_span::Span;
66
use rustc_hash::FxHashMap;
7+
use schemars::JsonSchema;
78

89
use 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)]
3840
pub 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

120108
impl Rule for RequireTopLevelDescribe {

0 commit comments

Comments
 (0)