Skip to content

chore(linter/no-loss-of-precision): re-port eslint test cases#20000

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/03-04-chore_linter_no-loss-of-precision_re-port_eslint_test_cases
Mar 4, 2026
Merged

chore(linter/no-loss-of-precision): re-port eslint test cases#20000
graphite-app[bot] merged 1 commit intomainfrom
c/03-04-chore_linter_no-loss-of-precision_re-port_eslint_test_cases

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Mar 4, 2026

No description provided.

@camc314 camc314 marked this pull request as ready for review March 4, 2026 10:45
Copilot AI review requested due to automatic review settings March 4, 2026 10:45
Copy link
Contributor Author

camc314 commented Mar 4, 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.

@github-actions github-actions bot added A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Mar 4, 2026
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 updates the eslint/no-loss-of-precision rule implementation and its snapshot expectations to re-port/align a broader set of ESLint test cases, especially around numeric literal formatting edge cases.

Changes:

  • Adjust numeric normalization logic to differentiate float-like literals (e.g. .42, 42., 9.00e2) from integer literals during precision comparisons.
  • Expand/reshuffle the rule’s pass/fail test cases to cover additional ESLint scenarios (underscored digits, leading/trailing decimal points, exponent forms, etc.).
  • Update the corresponding insta snapshot output to match the new test corpus and diagnostic locations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs Updates normalization/comparison behavior and refreshes the embedded rule test vectors.
crates/oxc_linter/src/snapshots/eslint_no_loss_of_precision.snap Updates expected diagnostic snapshots to match the updated test cases and spans.

You can also share your feedback on Copilot code review. Take the survey.

@graphite-app graphite-app bot changed the base branch from c/03-04-fix_linter_no-loss-of-precision_avoid_double_rounding_for_negative_exponents to graphite-base/20000 March 4, 2026 10:49
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 4, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 52 skipped benchmarks1


Comparing c/03-04-chore_linter_no-loss-of-precision_re-port_eslint_test_cases (12c0beb) with main (27ee4fc)

Open in CodSpeed

Footnotes

  1. 52 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.

@graphite-app graphite-app bot force-pushed the c/03-04-chore_linter_no-loss-of-precision_re-port_eslint_test_cases branch from 39794eb to 998d026 Compare March 4, 2026 10:56
@graphite-app graphite-app bot force-pushed the graphite-base/20000 branch from dd5f3f5 to 27ee4fc Compare March 4, 2026 10:56
@graphite-app graphite-app bot changed the base branch from graphite-base/20000 to main March 4, 2026 10:57
@graphite-app graphite-app bot force-pushed the c/03-04-chore_linter_no-loss-of-precision_re-port_eslint_test_cases branch from 998d026 to 12c0beb Compare March 4, 2026 10:57
@camc314 camc314 self-assigned this Mar 4, 2026
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Mar 4, 2026
Copy link
Contributor Author

camc314 commented Mar 4, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the c/03-04-chore_linter_no-loss-of-precision_re-port_eslint_test_cases branch from 12c0beb to 9b747ce Compare March 4, 2026 12:21
@graphite-app graphite-app bot merged commit 9b747ce into main Mar 4, 2026
21 checks passed
@graphite-app graphite-app bot deleted the c/03-04-chore_linter_no-loss-of-precision_re-port_eslint_test_cases branch March 4, 2026 12:26
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 4, 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.

2 participants