Skip to content

feat(linter): add fix for unused disable directive #11708

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

Merged

Conversation

Sysix
Copy link
Member

@Sysix Sysix commented Jun 14, 2025

Added tests for later, see linked issue #11709.

screenshot of code action in VSCode

// oxlint-disable-next-line no-debugger -- on wrong line
(() => {
  debugger;
})();

will fix to:

//
(() => {
  debugger;
})();

Not the best, but at least a start.
Don't know what kind of fix it should be. It is currently a SafeFix.

ToDo:

  • No other code actions ✔️
  • generate correct spans for directives with multiple rules ✔️

@Sysix Sysix changed the title feat(linter): add fix for unused diusable directive feat(linter): add fix for unused disable directive Jun 14, 2025
@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-editor Area - Editor and Language Server C-enhancement Category - New feature or request labels Jun 14, 2025
Copy link
Member Author

Sysix commented Jun 14, 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.

Copy link

codspeed-hq bot commented Jun 14, 2025

CodSpeed Instrumentation Performance Report

Merging #11708 will not alter performance

Comparing 06-14-feat_linter_add_fix_for_unused_diusable_directive (1a54184) with main (816ff03)

Summary

✅ 38 untouched benchmarks

@Sysix Sysix force-pushed the 06-14-feat_linter_add_fix_for_unused_diusable_directive branch from 94f8045 to 97b748b Compare June 14, 2025 16:56
@Sysix Sysix marked this pull request as ready for review June 14, 2025 17:13
@Sysix Sysix requested a review from camc314 as a code owner June 14, 2025 17:13
@Sysix Sysix marked this pull request as draft June 14, 2025 17:18
@Sysix Sysix force-pushed the 06-14-feat_linter_add_fix_for_unused_diusable_directive branch 4 times, most recently from 3e64d96 to d7fa8df Compare June 14, 2025 18:34
@Sysix Sysix marked this pull request as ready for review June 14, 2025 18:36
@Sysix Sysix marked this pull request as draft June 15, 2025 13:56
@Sysix Sysix changed the base branch from main to graphite-base/11708 June 19, 2025 13:56
@Sysix Sysix force-pushed the 06-14-feat_linter_add_fix_for_unused_diusable_directive branch from d7fa8df to 8884040 Compare June 19, 2025 13:56
@Sysix Sysix changed the base branch from graphite-base/11708 to 06-17-refactor_linter_output_smaller_spans_for_unused_disable_directives_with_multiple_rules June 19, 2025 13:56
@Sysix Sysix force-pushed the 06-14-feat_linter_add_fix_for_unused_diusable_directive branch 2 times, most recently from ccd4538 to 2f9d125 Compare June 19, 2025 15:53
@graphite-app graphite-app bot changed the base branch from 06-17-refactor_linter_output_smaller_spans_for_unused_disable_directives_with_multiple_rules to graphite-base/11708 June 20, 2025 09:19
@graphite-app graphite-app bot force-pushed the 06-14-feat_linter_add_fix_for_unused_diusable_directive branch from 2f9d125 to b3cd1ee Compare June 20, 2025 09:25
@graphite-app graphite-app bot force-pushed the graphite-base/11708 branch from 285f0a5 to b39d1fa Compare June 20, 2025 09:25
@graphite-app graphite-app bot changed the base branch from graphite-base/11708 to main June 20, 2025 09:26
@graphite-app graphite-app bot force-pushed the 06-14-feat_linter_add_fix_for_unused_diusable_directive branch from b3cd1ee to c20a77d Compare June 20, 2025 09:26
@Sysix Sysix force-pushed the 06-14-feat_linter_add_fix_for_unused_diusable_directive branch from c20a77d to b0267e6 Compare June 20, 2025 11:06
@Sysix Sysix marked this pull request as ready for review June 20, 2025 11:07
@Sysix Sysix force-pushed the 06-14-feat_linter_add_fix_for_unused_diusable_directive branch 2 times, most recently from 8affa74 to e2fbd4c Compare June 20, 2025 11:30
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jun 20, 2025
Copy link
Contributor

camc314 commented Jun 20, 2025

Merge activity

Added tests for later, see linked issue #11709.

![screenshot of code action in VSCode](https://github.com/user-attachments/assets/fc102ca2-0d57-42b1-87b7-235e19a50b4c)

```
// oxlint-disable-next-line no-debugger -- on wrong line
(() => {
  debugger;
})();
```

will fix to:

```
//
(() => {
  debugger;
})();
```

Not the best, but at least a start.
Don't know what kind of fix it should be. It is currently a `SafeFix`.

ToDo:

- No other code actions ✔️
- generate correct spans for directives with multiple rules ✔️
@graphite-app graphite-app bot force-pushed the 06-14-feat_linter_add_fix_for_unused_diusable_directive branch from e2fbd4c to 1a54184 Compare June 20, 2025 11:48
@graphite-app graphite-app bot merged commit 1a54184 into main Jun 20, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 06-14-feat_linter_add_fix_for_unused_diusable_directive branch June 20, 2025 11:51
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area - CLI 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.

2 participants