docs(linter): Improve eslint/no-loss-of-precision docs.#16730
docs(linter): Improve eslint/no-loss-of-precision docs.#16730graphite-app[bot] merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the documentation for the eslint/no-loss-of-precision rule and adds test coverage for let and const variable declarations. The documentation changes enhance clarity and professionalism by adding proper punctuation, expanding "JS" to "JavaScript", and improving wording precision. The test additions ensure the rule works correctly regardless of the variable declaration keyword used.
Key Changes
- Enhanced rule documentation with proper punctuation and clearer language ("JavaScript" instead of "JS", "unexpected/incorrect behavior" for precision)
- Added 6 passing test cases using
letandconstdeclarations - Added 8 failing test cases using
letandconstdeclarations to match existingvartest coverage
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 | Improved documentation clarity and punctuation; added test cases for let and const variable declarations alongside existing var tests |
| crates/oxc_linter/src/snapshots/eslint_no_loss_of_precision.snap | Updated snapshot with 8 new test failure outputs for the added let and const test cases |
Summary: The changes look excellent. The documentation improvements enhance clarity and professionalism, and the test additions appropriately expand coverage to ensure the rule works consistently across all JavaScript variable declaration keywords. No issues were identified during the review.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #16730 will not alter performanceComparing Summary
Footnotes
|
Merge activity
|
And also add a few test cases for let/const. Previously it only tested `var` cases, so just copied a few examples to let/const to make sure the rule won't have any risk of relying on `var` somehow in the future.
cca5032 to
a2c9d16
Compare
And also add a few test cases for let/const. Previously it only tested
varcases, so just copied a few examples to let/const to make sure the rule won't have any risk of relying onvarsomehow in the future.