Skip to content

linter: imports are not marked as unused when exported but unreferenced #21930

Description

@20jasper

What version of Oxlint are you using?

1.62.0

What command did you run?

pnpm exec oxlint ./packages/core/src/hi.ts

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "ignorePatterns": ["dist", "**/__doctests__"],
  "env": {
    "browser": true,
    "node": true,
    "es2026": true,
    "vitest": true
  },
  "options": {
    "typeAware": true
  },
  "plugins": ["eslint", "typescript", "unicorn", "vitest", "import", "node", "promise", "oxc"],
  "rules": {
    "no-console": "error",
    "no-shadow": "off"
  },
  "overrides": [
    {
      "files": ["packages/core/src/logger.ts"],
      "rules": {
        "no-console": "off"
      }
    }
  ],
  "categories": {
    "correctness": "error",
    "suspicious": "warn",
    "perf": "warn"
  }
}

What happened?

imports are not marked as unused when exported but unreferenced

import { resolve } from "path";
 × eslint(no-unused-vars): Identifier 'resolve' is imported but never used.
   ╭─[packages/core/src/hi.ts:1:10]
 1 │ import { resolve } from "path";
   ·          ───┬───
   ·             ╰── 'resolve' is imported here
 2 │ 
   ╰────
  help: Consider removing this import.
import { resolve } from "path";

export { resolve } from "path";
Found 0 warnings and 0 errors.
Finished in 160ms on 1 file with 194 rules using 12 threads.

Metadata

Metadata

Assignees

Labels

Type

Fields

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions