{"record":{"id":"d1b603919a9899f5","repo":"oxc-project/oxc","slug":"title-description-can-not-have-the-same-content-as","errorCode":null,"errorMessage":"Title description can not have the same content as a imported function name.","messagePattern":"Title description can not have the same content as a imported function name\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/vitest/prefer_describe_function_title.rs","lineNumber":16,"sourceCode":"use oxc_ast::{\n    AstKind,\n    ast::{Argument, Expression},\n};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::Span;\n\nuse crate::{\n    context::LintContext,\n    rule::Rule,\n    utils::{JestFnKind, JestGeneralFnKind, PossibleJestNode, parse_general_jest_fn_call},\n};\n\nfn prefer_describe_function_title_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Title description can not have the same content as a imported function name.\")\n        .with_help(\"Pass the function as a description title argument or modify the description title to not match any imported function name.\")\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone)]\npub struct PreferDescribeFunctionTitle;\n\ndeclare_oxc_lint!(\n    /// ### What it does\n    ///\n    /// When testing a specific function, this rule aims to enforce passing a named function to `describe()`\n    /// instead of an equivalent hardcoded string.\n    ///\n    /// ### Why is this bad?\n    ///\n    /// For tests that are related to a specific function, if the function being tested is renamed,\n    /// the describe title will no longer match and can cause confusion in the future. Using the function\n    /// directly ensures consistency even if the function is renamed.","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/vitest/prefer_describe_function_title.rs#L1-L34","documentation":"Emitted by the vitest/prefer-describe-function-title rule when a `describe` title string exactly matches the name of an imported function. It fires because the title likely interpolates or shadows the identifier incorrectly — either the function itself should be passed as the title or the string should differ, otherwise the test name is misleading.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/vitest/prefer_describe_function_title.rs:16 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the imported function directly as the title argument, e.g. `describe(myFn, () => {...})`","Rename the title string so it does not duplicate an imported function name"],"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-14T05:17:10.506Z"}