Skip to content

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Oct 30, 2025

Aligning with oxlint CLI tool.

This PR adds support for disable directives (e.g., oxlint-disable-next-line, eslint-disable) in type-aware linting with tsgolint. Previously, disable directives were only handled by the regular oxc linter, but now they also apply to type-aware rules.

Copy link
Member Author

Sysix commented Oct 30, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-linter Area - Linter A-editor Area - Editor and Language Server C-enhancement Category - New feature or request labels Oct 30, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 30, 2025

CodSpeed Performance Report

Merging #15170 will not alter performance

Comparing 10-30-feat_language_server_respect_disable_directives_for_type-aware_rules (6766b1c) with main (26f24d5)1

Summary

✅ 4 untouched
⏩ 33 skipped2

Footnotes

  1. No successful run was found on main (778b0b6) during the generation of this report, so 26f24d5 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 33 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Sysix Sysix force-pushed the 10-30-feat_language_server_respect_disable_directives_for_type-aware_rules branch from ccc5f30 to 1a0118f Compare October 30, 2025 22:34
@Sysix Sysix force-pushed the 10-30-refactor_language_server_remove_serverlinterdiagnostics_ branch from d467e12 to 2c84365 Compare October 31, 2025 10:43
@Sysix Sysix force-pushed the 10-30-feat_language_server_respect_disable_directives_for_type-aware_rules branch 2 times, most recently from 709936b to cd0c2a8 Compare October 31, 2025 10:47
@Sysix Sysix force-pushed the 10-30-refactor_language_server_remove_serverlinterdiagnostics_ branch from 2c84365 to 1547df2 Compare October 31, 2025 10:47
@Sysix Sysix requested a review from Copilot October 31, 2025 11:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for disable directives (e.g., oxlint-disable-next-line, eslint-disable) in type-aware linting with tsgolint. Previously, disable directives were only handled by the regular oxc linter, but now they also apply to type-aware rules.

Key changes:

  • Extracted duplicate disable directive checking logic into a reusable should_skip_diagnostic function
  • Modified lint_source to accept and use the shared disable_directives_map for filtering diagnostics
  • Added comprehensive test coverage for disable directives with type-aware rules

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
crates/oxc_linter/src/tsgolint.rs Refactored duplicate disable directive checking into should_skip_diagnostic function and integrated it into both lint and lint_source methods
crates/oxc_linter/src/lint_runner.rs Updated run_source to pass disable directives map to type-aware linter
crates/oxc_language_server/fixtures/linter/tsgolint/unused_disabled_directives/.oxlintrc.json Configuration file for testing disable directives with type-aware rules
crates/oxc_language_server/fixtures/linter/tsgolint/unused_disabled_directives/test.ts Test file demonstrating various disable directive formats with type-aware rules
crates/oxc_language_server/src/linter/server_linter.rs Added test case for reporting unused directives with tsgolint
crates/oxc_language_server/src/snapshots/fixtures_linter_tsgolint_unused_disabled_directives@test.ts.snap Snapshot of expected output for disable directives test

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sysix Sysix force-pushed the 10-30-feat_language_server_respect_disable_directives_for_type-aware_rules branch from cd0c2a8 to 935a9f4 Compare October 31, 2025 11:28
@Sysix Sysix force-pushed the 10-30-refactor_language_server_remove_serverlinterdiagnostics_ branch from 1547df2 to 57f4002 Compare October 31, 2025 11:28
@Sysix Sysix marked this pull request as ready for review October 31, 2025 11:39
@Sysix Sysix requested a review from camc314 as a code owner October 31, 2025 11:39
@Sysix Sysix force-pushed the 10-30-feat_language_server_respect_disable_directives_for_type-aware_rules branch from 935a9f4 to 4ad88f1 Compare November 3, 2025 18:05
@Sysix Sysix force-pushed the 10-30-refactor_language_server_remove_serverlinterdiagnostics_ branch from 57f4002 to 039883c Compare November 3, 2025 18:05
@graphite-app graphite-app bot force-pushed the 10-30-refactor_language_server_remove_serverlinterdiagnostics_ branch 2 times, most recently from c8ef3d6 to ade11f5 Compare November 3, 2025 18:16
@graphite-app graphite-app bot force-pushed the 10-30-feat_language_server_respect_disable_directives_for_type-aware_rules branch from 4ad88f1 to c8e6d98 Compare November 3, 2025 18:16
@graphite-app graphite-app bot changed the base branch from 10-30-refactor_language_server_remove_serverlinterdiagnostics_ to graphite-base/15170 November 4, 2025 14:43
@graphite-app graphite-app bot force-pushed the 10-30-feat_language_server_respect_disable_directives_for_type-aware_rules branch from c8e6d98 to 9f803d3 Compare November 4, 2025 14:48
@graphite-app graphite-app bot force-pushed the graphite-base/15170 branch from ade11f5 to 778b0b6 Compare November 4, 2025 14:48
@graphite-app graphite-app bot changed the base branch from graphite-base/15170 to main November 4, 2025 14:48
@graphite-app graphite-app bot force-pushed the 10-30-feat_language_server_respect_disable_directives_for_type-aware_rules branch from 9f803d3 to 6766b1c Compare November 4, 2025 14:49
Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Nov 5, 2025
Copy link
Contributor

camc314 commented Nov 5, 2025

Merge activity

#15170)

Aligning with `oxlint` CLI tool.

> This PR adds support for disable directives (e.g., oxlint-disable-next-line, eslint-disable) in type-aware linting with tsgolint. Previously, disable directives were only handled by the regular oxc linter, but now they also apply to type-aware rules.
@graphite-app graphite-app bot force-pushed the 10-30-feat_language_server_respect_disable_directives_for_type-aware_rules branch from 6766b1c to 798216b Compare November 5, 2025 09:15
@graphite-app graphite-app bot merged commit 798216b into main Nov 5, 2025
21 checks passed
@graphite-app graphite-app bot deleted the 10-30-feat_language_server_respect_disable_directives_for_type-aware_rules branch November 5, 2025 09:20
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 5, 2025
@Boshen Boshen mentioned this pull request Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-editor Area - Editor and Language Server A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants