chore(linter/no-loss-of-precision): re-port eslint test cases#20000
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 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.
Merging this PR will not alter performance
Comparing Footnotes
|
39794eb to
998d026
Compare
dd5f3f5 to
27ee4fc
Compare
998d026 to
12c0beb
Compare
Merge activity
|
12c0beb to
9b747ce
Compare

No description provided.