-
-
Notifications
You must be signed in to change notification settings - Fork 721
feat(language_server): respect disable directives for type-aware rules #15170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(language_server): respect disable directives for type-aware rules #15170
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
CodSpeed Performance ReportMerging #15170 will not alter performanceComparing Summary
Footnotes
|
ccc5f30 to
1a0118f
Compare
d467e12 to
2c84365
Compare
709936b to
cd0c2a8
Compare
2c84365 to
1547df2
Compare
There was a problem hiding this 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_diagnosticfunction - Modified
lint_sourceto accept and use the shareddisable_directives_mapfor 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.
crates/oxc_language_server/fixtures/linter/tsgolint/unused_disabled_directives/test.ts
Show resolved
Hide resolved
crates/oxc_language_server/fixtures/linter/tsgolint/unused_disabled_directives/test.ts
Show resolved
Hide resolved
crates/oxc_language_server/fixtures/linter/tsgolint/unused_disabled_directives/test.ts
Show resolved
Hide resolved
crates/oxc_language_server/fixtures/linter/tsgolint/unused_disabled_directives/test.ts
Show resolved
Hide resolved
crates/oxc_language_server/fixtures/linter/tsgolint/unused_disabled_directives/test.ts
Show resolved
Hide resolved
crates/oxc_language_server/fixtures/linter/tsgolint/unused_disabled_directives/test.ts
Show resolved
Hide resolved
crates/oxc_language_server/fixtures/linter/tsgolint/unused_disabled_directives/test.ts
Show resolved
Hide resolved
crates/oxc_language_server/fixtures/linter/tsgolint/unused_disabled_directives/test.ts
Show resolved
Hide resolved
cd0c2a8 to
935a9f4
Compare
1547df2 to
57f4002
Compare
935a9f4 to
4ad88f1
Compare
57f4002 to
039883c
Compare
c8ef3d6 to
ade11f5
Compare
4ad88f1 to
c8e6d98
Compare
c8e6d98 to
9f803d3
Compare
ade11f5 to
778b0b6
Compare
9f803d3 to
6766b1c
Compare
camc314
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
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.
6766b1c to
798216b
Compare

Aligning with
oxlintCLI tool.