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/max_expects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::Span;
use rustc_hash::FxHashMap;
use schemars::JsonSchema;

use crate::{
context::LintContext,
Expand All @@ -16,8 +17,10 @@ fn exceeded_max_assertion(count: usize, max: usize, span: Span) -> OxcDiagnostic
.with_label(span)
}

#[derive(Debug, Clone)]
#[derive(Debug, Clone, JsonSchema)]
#[serde(rename_all = "camelCase", default)]
pub struct MaxExpects {
/// Maximum number of `expect()` assertion calls allowed within a single test.
pub max: usize,
}

Expand All @@ -37,7 +40,7 @@ declare_oxc_lint!(
/// ### Why is this bad?
///
/// This rule enforces a maximum number of `expect()` calls.
/// The following patterns are considered warnings (with the default option of `{ "max": 5 } `):
/// The following patterns are considered warnings (with the default max of 5):
///
/// ### Examples
///
Expand All @@ -64,6 +67,7 @@ declare_oxc_lint!(
MaxExpects,
jest,
style,
config = MaxExpects,
);

impl Rule for MaxExpects {
Expand Down
Loading