linter: --report-unused-disable-directives omits the rule names when every rule in a directive is unused
Generated by Claude, reviewed by myself.
What version of Oxlint are you using?
1.80.0 (also reproduces on 1.81.0)
What command did you run?
oxlint -c .oxlintrc.json --report-unused-disable-directives a.js
What does your .oxlintrc.json config file look like?
{
"rules": {
"no-debugger": "error",
"no-empty": "error"
}
}
What happened?
When a disable directive is entirely unused, oxlint reports it without saying which rules it names. ESLint includes them.
Oxlint already has the naming path — it uses it when only some of a directive's rules are unused — so this is specifically the all-unused case falling back to a bare message.
a.js:
// eslint-disable-next-line no-debugger
export const one = 1;
// eslint-disable-next-line no-debugger, no-empty
export const two = 2;
/* eslint-disable no-debugger */
export const three = 3;
Oxlint 1.80.0:
a.js:1:1: warning: Unused eslint-disable directive (no problems were reported).
a.js:4:1: warning: Unused eslint-disable directive (no problems were reported).
a.js:7:1: warning: Unused eslint-disable directive (no problems were reported).
ESLint 9.39.5 on the same file with reportUnusedDisableDirectives: 'warn':
1:1 Unused eslint-disable directive (no problems were reported from 'no-debugger').
4:1 Unused eslint-disable directive (no problems were reported from 'no-debugger' or 'no-empty').
7:1 Unused eslint-disable directive (no problems were reported from 'no-debugger').
The partial case already names them
When a directive lists several rules and only some are unused, oxlint names the rule and anchors the diagnostic at that rule's column inside the directive, which is more precise than ESLint:
foo.test.ts:1:19: warning: Unused eslint-disable directive (no problems were reported from @typescript-eslint/no-unnecessary-type-assertion).
foo.test.ts:1:69: warning: Unused eslint-disable directive (no problems were reported from @typescript-eslint/no-unsafe-argument).
So the formatting exists; the all-unused branch just does not use it.
Why it matters
Migrating one package of a large monorepo from ESLint to Oxlint, --report-unused-disable-directives produced 69 warnings. 54 of them were the bare form, because most directives name exactly one rule — the most common shape in real code, and the case where the rule name is most reliably known. Each of those 54 required opening the file to find out what the directive was for.
It also makes the warnings hard to group. With rule names the 69 sort into a handful of causes in one pass; without them the bare majority is opaque in the log.
Expected
Include the rule names in the all-unused case, matching ESLint's wording:
Unused eslint-disable directive (no problems were reported from 'no-debugger').
Unused eslint-disable directive (no problems were reported from 'no-debugger' or 'no-empty').
A bare (no problems were reported) remains correct for a directive that names no rules at all, such as a blanket /* eslint-disable */ — that is what ESLint emits there too (verified).
Source: oxc-project/oxc