{"record":{"id":"bd7be15cf8722696","repo":"oxc-project/oxc","slug":"this-dependency-is-specified-more-than-once-in-the","errorCode":null,"errorMessage":"This dependency is specified more than once in the dependency array.","messagePattern":"This dependency is specified more than once in the dependency array\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/react/exhaustive_deps.rs","lineNumber":148,"sourceCode":"\nfn dependency_array_not_array_literal_diagnostic(hook_name: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\n        \"React Hook {hook_name} was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies.\"\n    ))\n    .with_label(span)\n    .with_help(\"Use an array literal as the second argument.\")\n    .with_error_code_scope(SCOPE)\n}\n\nfn literal_in_dependency_array_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"The literal is not a valid dependency because it never changes.\")\n        .with_label(span)\n        .with_help(\"Remove the literal from the array.\")\n        .with_error_code_scope(SCOPE)\n}\n\nfn duplicate_dependency_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"This dependency is specified more than once in the dependency array.\")\n        .with_label(span)\n        .with_help(\"Remove the duplicate dependency from the array.\")\n        .with_error_code_scope(SCOPE)\n}\n\nfn complex_expression_in_dependency_array_diagnostic(hook_name: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\n        \"React Hook {hook_name} has a complex expression in the dependency array.\",\n    ))\n    .with_label(span)\n    .with_help(\"Extract the expression to a separate variable so it can be statically checked.\")\n    .with_error_code_scope(SCOPE)\n}\n\nfn dependency_changes_on_every_render_diagnostic(\n    hook_name: &str,\n    span: Span,\n    dep_name: &str,","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/oxc-project/oxc/blob/1f902a69625cd14e6d8dc58feca94da099d2d251/crates/oxc_linter/src/rules/react/exhaustive_deps.rs#L130-L166","documentation":"Raised by react/exhaustive_deps when the same dependency appears more than once in a hook's dependency array. At the throw site the duplicate entry is redundant — React only reads it once — and it usually signals a copy/paste mistake or an oversight when editing the list. run() detects repeated identifiers within a single dependency array literal and reports the duplicated element span.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/react/exhaustive_deps.rs:153 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove duplicate entries so each dependency appears exactly once."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1f902a69625cd14e6d8dc58feca94da099d2d251","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}