Skip to content

Commit 7fe43fc

Browse files
committed
docs(linter): Add configuration option docs for jest/no-hooks rule.
1 parent ec23a08 commit 7fe43fc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use oxc_ast::{AstKind, ast::Expression};
22
use oxc_diagnostics::OxcDiagnostic;
33
use oxc_macros::declare_oxc_lint;
44
use oxc_span::{CompactStr, GetSpan, Span};
5+
use schemars::JsonSchema;
56

67
use crate::{
78
context::LintContext,
@@ -16,8 +17,10 @@ fn unexpected_hook_diagonsitc(span: Span) -> OxcDiagnostic {
1617
#[derive(Debug, Default, Clone)]
1718
pub struct NoHooks(Box<NoHooksConfig>);
1819

19-
#[derive(Debug, Default, Clone)]
20+
#[derive(Debug, Default, Clone, JsonSchema)]
21+
#[serde(rename_all = "camelCase", default)]
2022
pub 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

8690
impl Rule for NoHooks {

0 commit comments

Comments
 (0)