Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions crates/oxc_linter/src/rules/jest/require_hook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_semantic::AstNode;
use oxc_span::{CompactStr, Span};
use schemars::JsonSchema;

use crate::{
context::LintContext,
Expand All @@ -23,8 +24,10 @@ fn use_hook(span: Span) -> OxcDiagnostic {
.with_label(span)
}

#[derive(Debug, Default, Clone)]
#[derive(Debug, Default, Clone, JsonSchema)]
#[serde(rename_all = "camelCase", default)]
pub struct RequireHookConfig {
/// An array of function names that are allowed to be called outside of hooks.
allowed_function_calls: Vec<CompactStr>,
}

Expand Down Expand Up @@ -157,7 +160,8 @@ declare_oxc_lint!(
/// ```
RequireHook,
jest,
style
style,
config = RequireHookConfig
);

impl Rule for RequireHook {
Expand Down
Loading