Skip to content

fix(linter): correct reportUnusedDisableDirectives off behavior, add integration tests, update docstring#2

Merged
wagenet merged 2 commits intounused-disables-flagfrom
copilot/fix-issues-in-pr-19799
Feb 27, 2026
Merged

fix(linter): correct reportUnusedDisableDirectives off behavior, add integration tests, update docstring#2
wagenet merged 2 commits intounused-disables-flagfrom
copilot/fix-issues-in-pr-19799

Conversation

Copy link

Copilot AI commented Feb 27, 2026

Addresses three issues flagged in the Copilot review of oxc-project#19799.

off/allow not actually disabling unused-directive reporting

WithSeverity(Some(Allow)) was passing through as Some(Allow), which downstream report_unused_directives treated as "report as warning". The same bug existed for the config-store fallback. Now both paths filter AllowNone.

// Before: Allow slipped through and still triggered reporting
ReportUnusedDirectives::WithSeverity(Some(severity)) => Some(severity),
_ => config_store.report_unused_disable_directives(),

// After: only Warn/Deny propagate; Allow (off) disables reporting
ReportUnusedDirectives::WithSeverity(Some(severity)) if severity.is_warn_deny() => Some(severity),
ReportUnusedDirectives::WithSeverity(Some(_)) => None,
_ => match config_store.report_unused_disable_directives() {
    Some(severity) if severity.is_warn_deny() => Some(severity),
    _ => None,
},

Integration tests for config-file path

The existing test only covered the CLI flag path. Two new snapshot tests added:

  • test_report_unused_directives_from_configreportUnusedDisableDirectives: "warn" in .oxlintrc.json reports without any CLI flag
  • test_report_unused_directives_cli_overrides_config — CLI --report-unused-disable-directives-severity=off suppresses config-level "warn"

Docstring mentions only eslint-disable-line

Updated to // oxlint-disable-line or // eslint-disable-line to reflect that both prefixes are supported. Propagated to all generated files (config.generated.ts, configuration_schema.json, website snapshots).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…egration tests

Co-authored-by: wagenet <9835+wagenet@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix problems noted in PR #19799 fix(linter): correct reportUnusedDisableDirectives off behavior, add integration tests, update docstring Feb 27, 2026
@wagenet wagenet marked this pull request as ready for review February 27, 2026 19:39
@wagenet wagenet merged commit 6c810fb into unused-disables-flag Feb 27, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants