{"record":{"id":"85de36bffd6b0c2d","repo":"oxc-project/oxc","slug":"fn-kind-can-not-be-used-with-method-used","errorCode":null,"errorMessage":"`{fn_kind}` can not be used with `.{method_used}` to create parameterized test.","messagePattern":"`(.+?)` can not be used with `\\.(.+?)` to create parameterized test\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/vitest/consistent_each_for.rs","lineNumber":28,"sourceCode":"use crate::{\n    context::LintContext,\n    rule::{DefaultRuleConfig, Rule},\n    utils::{JestFnKind, JestGeneralFnKind, PossibleJestNode, parse_general_jest_fn_call},\n};\n\nfn consistent_each_for_diagnostic(\n    span: Span,\n    fn_kind: &str,\n    method_used: &str,\n    method_name: &CompactStr,\n) -> OxcDiagnostic {\n    let message =\n        format!(\"`{fn_kind}` can not be used with `.{method_used}` to create parameterized test.\");\n    let help = format!(\n        \"To create parameterized test with `{fn_kind}` function you should use `{method_name}`\"\n    );\n\n    OxcDiagnostic::warn(message).with_help(help).with_label(span)\n}\n\n#[derive(Debug, Default, Clone)]\npub struct ConsistentEachFor(Box<ConsistentEachForConfig>);\n\nimpl std::ops::Deref for ConsistentEachFor {\n    type Target = ConsistentEachForConfig;\n\n    fn deref(&self) -> &Self::Target {\n        &self.0\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, Eq, JsonSchema, Deserialize)]\n#[serde(rename_all = \"lowercase\")]\npub enum MemberNames {\n    /// Prefer using `.for` to create parameterized tests.\n    For,","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/vitest/consistent_each_for.rs#L10-L46","documentation":"Emitted by the vitest/consistent-each-for rule when a `.each`-style parameterized test function (e.g. `test.each`) is combined with the mismatched `.for` accessor (or vice versa). It fires at the call span because vitest requires the matching pairing (`it.each` with `.each`, `test.for` with `.for`) and mixing them is a mistake.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/vitest/consistent_each_for.rs:28 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the matching method name suggested in the help, e.g. replace `test.each` with `test.for`","Keep `fn_kind` and the accessor consistent across the test file"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}