Skip to content

Comments

refactor(linter/no-constant-condition): add label to span and better help text#17860

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-10-refactor_linter_no-constant-condition_add_label_to_span_and_better_help_text
Jan 11, 2026
Merged

refactor(linter/no-constant-condition): add label to span and better help text#17860
graphite-app[bot] merged 1 commit intomainfrom
01-10-refactor_linter_no-constant-condition_add_label_to_span_and_better_help_text

Conversation

@camchenry
Copy link
Member

@camchenry camchenry commented Jan 11, 2026

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

@github-actions github-actions bot added A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Jan 11, 2026
Copy link
Member Author

camchenry commented Jan 11, 2026


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
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 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-hq
Copy link

codspeed-hq bot commented Jan 11, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing 01-10-refactor_linter_no-constant-condition_add_label_to_span_and_better_help_text (9281247) with main (e3c7d0b)1

Summary

✅ 4 untouched benchmarks
⏩ 41 skipped benchmarks2

Footnotes

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

  2. 41 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.

@camchenry camchenry force-pushed the 01-10-refactor_linter_no-constant-condition_add_label_to_span_and_better_help_text branch from f74562d to 9281247 Compare January 11, 2026 04:05
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Jan 11, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 11, 2026

Merge activity

…help text (#17860)

Made the help text more specific, and added a short label to the span that briefly states the problem.
@graphite-app graphite-app bot force-pushed the 01-10-refactor_linter_no-constant-condition_add_label_to_span_and_better_help_text branch from 9281247 to 6c56c95 Compare January 11, 2026 05:13
@graphite-app graphite-app bot merged commit 6c56c95 into main Jan 11, 2026
20 checks passed
@graphite-app graphite-app bot deleted the 01-10-refactor_linter_no-constant-condition_add_label_to_span_and_better_help_text branch January 11, 2026 05:18
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant