{"record":{"id":"1fb744f567ba25c6","repo":"oxc-project/oxc","slug":"pronoun-name-is-imported-but-never-used","errorCode":null,"errorMessage":"{pronoun} '{name}' is imported but never used.","messagePattern":"(.+?) '(.+?)' is imported but never used\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"warning","filePath":"crates/oxc_linter/src/rules/eslint/no_unused_vars/diagnostic.rs","lineNumber":139,"sourceCode":"    } else {\n        pat.diagnostic_help(\"parameters\")\n    };\n\n    OxcDiagnostic::warn(if only_used_as_type {\n        format!(\"Parameter '{name}' is declared but only used as a type.{suffix}\")\n    } else {\n        format!(\"Parameter '{name}' is declared but never used.{suffix}\")\n    })\n    .with_label(symbol.span().label(format!(\"'{name}' is declared here\")))\n    .with_help(\"Consider removing this parameter.\")\n}\n\n/// Identifier 'x' imported but never used.\npub fn imported(symbol: &Symbol<'_, '_>) -> OxcDiagnostic {\n    let (pronoun, _) = pronoun_for_symbol(symbol.flags());\n    let name = symbol.name();\n\n    OxcDiagnostic::warn(format!(\"{pronoun} '{name}' is imported but never used.\"))\n        .with_label(symbol.span().label(format!(\"'{name}' is imported here\")))\n        .with_help(\"Consider removing this import.\")\n}\n","sourceCodeStart":121,"sourceCodeEnd":143,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/eslint/no_unused_vars/diagnostic.rs#L121-L143","documentation":"no-unused-vars import variant: an imported binding is never referenced, so the import is dead code that obscures real dependencies and can bloat bundles in toolchains that cannot tree-shake. The label points at the import span.","triggerScenarios":"import { debounce } from 'lodash-es'; with no debounce usage anywhere in the module; type imports kept after switching to inline types; barrel-file imports of unused symbols.","commonSituations":"Refactors removing call sites; IDE auto-import pulling in unused names; switching values to import type; re-export cleanup.","solutions":["Delete the unused specifier (or the whole import statement if no specifiers remain).","If it is only used as a type, convert to import type { X }.","Run an organize-imports fixer (editor action or oxlint --fix where configured) before committing."],"exampleFix":"// before\nimport { ref, computed } from 'vue';\nexport const x = 1;\n// after\nexport const x = 1;","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable editor organize-imports on save to remove unused imports automatically.","Use import type for type-only imports so the distinction is explicit.","Delete imports in the same change that removes their last usage."],"tags":["eslint","oxlint","unused-vars","imports","dead-code"],"backgroundTag":"unused-import","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"}