Confirm that this is a Bug for the editor extension, not the CLI
Versions used
VS Code extension: v1.52.0
oxlint: v1.58.0
oxfmt: v0.43.0
VS Code version: 1.105.1
Operating System and Version: macOs 26.3.1
Node Version: v24.12.0
Node Manager: npm v11.6.2
What happened?
When Oxlint reports an unused disable directive (e.g. with reportUnusedDisableDirectives enabled in the Oxlint config), the CLI does not offer an auto-fix for that diagnostic. The VS Code extension does apply a fix (e.g. via Fix all / source.fixAll.oxc on save), but the fix is wrong: it strips the directive text and leaves an empty comment on the line (// or /**/) instead of removing the whole line, which matches what users expect from ESLint-style tooling and leaves noisy, useless lines in the file.
Steps to reproduce
- Clone https://github.com/arsnl/oxlint-repro-file-level-disable and open the folder in VS Code.
- Run
npm install.
- In
.vscode/settings.json, set "source.fixAll.oxc" to "always" under editor.codeActionsOnSave (or use Fix all from the lightbulb on an unused-disable diagnostic).
- Save
test.ts (or trigger fix all).
Actual behavior: Lines that contained only the disable comment become // or /**/ with nothing after it.
Expected behavior: The entire line should be removed when nothing meaningful remains (same idea as removing a full eslint-disable line), not replaced with an empty comment token.
(Related upstream context: in that repro, file-level oxlint-disable for a file-scope rule may still leave the real rule violation plus an “unused directive” warning—that’s separate Oxlint engine behavior; this ticket is specifically about the editor fix leaving empty comments.)
Reproduction repo
https://github.com/arsnl/oxlint-repro-file-level-disable
Minimal workspace: test.ts, oxlint.config.ts (reportUnusedDisableDirectives: "warn"), and .vscode/ recommendations for oxc.oxc-vscode. See the “Reproduction (VS Code extension)” section in the repo README.md.
Output channel log
Click to expand
2026-04-05 14:42:48.027 [info] [Error - 14:42:48] Server process exited with code 0.
2026-04-05 14:42:48.028 [info] [Trace - 14:42:48] Received request 'client/registerCapability - (0)'.
2026-04-05 14:42:48.028 [info] Params: {
"registrations": [
{
"id": "watcher-formatter-file:///Users/arsnl/Developer/oxlint-repro-file-level-disable",
"method": "workspace/didChangeWatchedFiles",
"registerOptions": {
"watchers": [
{
"globPattern": {
"baseUri": "file:///Users/arsnl/Developer/oxlint-repro-file-level-disable",
"pattern": ".oxfmtrc.json"
},
"kind": 7
},
{
"globPattern": {
"baseUri": "file:///Users/arsnl/Developer/oxlint-repro-file-level-disable",
"pattern": ".oxfmtrc.jsonc"
},
"kind": 7
},
{
"globPattern": {
"baseUri": "file:///Users/arsnl/Developer/oxlint-repro-file-level-disable",
"pattern": "oxfmt.config.ts"
},
"kind": 7
},
{
"globPattern": {
"baseUri": "file:///Users/arsnl/Developer/oxlint-repro-file-level-disable",
"pattern": "vite.config.ts"
},
"kind": 7
},
{
"globPattern": {
"baseUri": "file:///Users/arsnl/Developer/oxlint-repro-file-level-disable",
"pattern": ".editorconfig"
},
"kind": 7
}
]
}
}
]
}
2026-04-05 14:42:48.028 [info] [Trace - 14:42:48] Sending response 'client/registerCapability - (0)'. Processing request took 0ms
2026-04-05 14:42:48.028 [info] No result returned.
2026-04-05 14:43:18.904 [info] [Trace - 14:43:18] Sending notification 'textDocument/didChange'.
2026-04-05 14:43:18.904 [info] Params: {
"textDocument": {
"uri": "file:///Users/arsnl/Developer/oxlint-repro-file-level-disable/test.ts",
"version": 3
},
"contentChanges": [
{
"text": "/**/\n\n//\nvar x = \"y\";"
}
]
}
Confirm that this is a Bug for the editor extension, not the CLI
Versions used
What happened?
When Oxlint reports an unused disable directive (e.g. with
reportUnusedDisableDirectivesenabled in the Oxlint config), the CLI does not offer an auto-fix for that diagnostic. The VS Code extension does apply a fix (e.g. via Fix all /source.fixAll.oxcon save), but the fix is wrong: it strips the directive text and leaves an empty comment on the line (//or/**/) instead of removing the whole line, which matches what users expect from ESLint-style tooling and leaves noisy, useless lines in the file.Steps to reproduce
npm install..vscode/settings.json, set"source.fixAll.oxc"to"always"undereditor.codeActionsOnSave(or use Fix all from the lightbulb on an unused-disable diagnostic).test.ts(or trigger fix all).Actual behavior: Lines that contained only the disable comment become
//or/**/with nothing after it.Expected behavior: The entire line should be removed when nothing meaningful remains (same idea as removing a full
eslint-disableline), not replaced with an empty comment token.(Related upstream context: in that repro, file-level
oxlint-disablefor a file-scope rule may still leave the real rule violation plus an “unused directive” warning—that’s separate Oxlint engine behavior; this ticket is specifically about the editor fix leaving empty comments.)Reproduction repo
https://github.com/arsnl/oxlint-repro-file-level-disable
Minimal workspace:
test.ts,oxlint.config.ts(reportUnusedDisableDirectives: "warn"), and.vscode/recommendations foroxc.oxc-vscode. See the “Reproduction (VS Code extension)” section in the repoREADME.md.Output channel log
Click to expand