refactor(linter/no-constant-condition): add label to span and better help text#17860
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. |
There was a problem hiding this comment.
Pull request overview
This PR refactors the no-constant-condition linter rule to add a descriptive label to diagnostic spans and improve the help message text.
Changes:
- Updated help text from "Constant expression as a test condition is not allowed" to "Update the condition to not be constant, or remove the condition entirely"
- Added a span label stating "this expression will always evaluate as true"
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_linter/src/rules/eslint/no_constant_condition.rs | Modified diagnostic to add span label and updated help text |
| crates/oxc_linter/src/snapshots/eslint_no_constant_condition.snap | Regenerated snapshot reflecting the new diagnostic format with label and help text across 135+ test cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
f74562d to
9281247
Compare
Merge activity
|
…help text (#17860) Made the help text more specific, and added a short label to the span that briefly states the problem.
9281247 to
6c56c95
Compare

Made the help text more specific, and added a short label to the span that briefly states the problem.