Summary
Disable directives can stop suppressing diagnostics when an explanation is added after the rule name. In the latest commit, several comments had to be changed from:
// oxlint-disable-next-line typescript/unbound-method - bound in `runHook`
to:
// oxlint-disable-next-line typescript/unbound-method
because the trailing explanation caused the directive to no longer match typescript/unbound-method.
Reproduction
class C {
method() {}
}
const c = new C();
// oxlint-disable-next-line typescript/unbound-method - bound later
const method = c.method;
Run:
oxlint --type-aware --type-check -D typescript/unbound-method repro.ts
Expected Behavior
The directive should suppress typescript/unbound-method, or oxlint should clearly document and/or diagnose unsupported trailing explanation syntax.
ESLint-style descriptions commonly use --, for example:
// oxlint-disable-next-line typescript/unbound-method -- bound later
const method = c.method;
That form should continue to work consistently across Rust linting, JS plugin APIs, unused-disable reporting, and autofixes.
Actual Behavior
With a trailing single-hyphen explanation, oxlint treats the explanation as part of the rule name, so the disabled rule becomes something like:
typescript/unbound-method - bound later
That does not match the emitted typescript/unbound-method diagnostic, so the warning/error is still reported.
Summary
Disable directives can stop suppressing diagnostics when an explanation is added after the rule name. In the latest commit, several comments had to be changed from:
// oxlint-disable-next-line typescript/unbound-method - bound in `runHook`to:
// oxlint-disable-next-line typescript/unbound-methodbecause the trailing explanation caused the directive to no longer match
typescript/unbound-method.Reproduction
Run:
Expected Behavior
The directive should suppress
typescript/unbound-method, or oxlint should clearly document and/or diagnose unsupported trailing explanation syntax.ESLint-style descriptions commonly use
--, for example:That form should continue to work consistently across Rust linting, JS plugin APIs, unused-disable reporting, and autofixes.
Actual Behavior
With a trailing single-hyphen explanation, oxlint treats the explanation as part of the rule name, so the disabled rule becomes something like:
That does not match the emitted
typescript/unbound-methoddiagnostic, so the warning/error is still reported.