What version of Oxlint are you using?
1.58.0
What command did you run?
oxlint
What does your .oxlintrc.json (or oxlint.config.ts) config file look like?
import { defineConfig } from "oxlint";
export default defineConfig({
/* disable all categories so that we can enable rules selectively */
categories: {
correctness: "off",
nursery: "off",
pedantic: "off",
perf: "off",
restriction: "off",
style: "off",
suspicious: "off",
},
plugins: ["import"],
rules: {
"import/unambiguous": "error"
},
options: {
reportUnusedDisableDirectives: "warn"
},
});
What happened?
File-level inline disable comments (e.g. /* oxlint-disable rule-id */ at the top of a file) do not suppress file-level rules the way ESLint’s eslint-disable does for comparable rules (e.g. import/unambiguous, unicorn/filename-case). As a result:
- The underlying rule still reports diagnostics.
- With
reportUnusedDisableDirectives enabled, Oxlint treats those disable comments as unused and reports something like "Unused eslint-disable directive (no problems were reported.)" even though the developer added the comment specifically to silence a file-scope violation.
Separately, the Oxlint VS Code extension (oxc.oxc-vscode) can apply a “fix” for unused-disable directives, but it leaves an empty comment (// or /**/) instead of removing the line, which is inconsistent with typical ESLint behavior and leaves noise in the file.
A minimal reproduction is available at https://github.com/arsnl/oxlint-repro-file-level-disable
What version of Oxlint are you using?
1.58.0
What command did you run?
oxlint
What does your
.oxlintrc.json(oroxlint.config.ts) config file look like?What happened?
File-level inline disable comments (e.g.
/* oxlint-disable rule-id */at the top of a file) do not suppress file-level rules the way ESLint’seslint-disabledoes for comparable rules (e.g.import/unambiguous,unicorn/filename-case). As a result:reportUnusedDisableDirectivesenabled, Oxlint treats those disable comments as unused and reports something like "Unused eslint-disable directive (no problems were reported.)" even though the developer added the comment specifically to silence a file-scope violation.Separately, the Oxlint VS Code extension (
oxc.oxc-vscode) can apply a “fix” for unused-disable directives, but it leaves an empty comment (//or/**/) instead of removing the line, which is inconsistent with typical ESLint behavior and leaves noise in the file.A minimal reproduction is available at https://github.com/arsnl/oxlint-repro-file-level-disable