Skip to content

docs(linter): Improve eslint/no-loss-of-precision docs.#16730

Merged
graphite-app[bot] merged 1 commit intomainfrom
no-loss-of-prec
Dec 11, 2025
Merged

docs(linter): Improve eslint/no-loss-of-precision docs.#16730
graphite-app[bot] merged 1 commit intomainfrom
no-loss-of-prec

Conversation

@connorshea
Copy link
Copy Markdown
Member

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.

@connorshea connorshea requested a review from camc314 as a code owner December 11, 2025 04:53
Copilot AI review requested due to automatic review settings December 11, 2025 04:53
@github-actions github-actions bot added A-linter Area - Linter C-docs Category - Documentation. Related to user-facing or internal documentation labels Dec 11, 2025
Copy link
Copy Markdown
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 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 let and const declarations
  • Added 8 failing test cases using let and const declarations to match existing var test 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-hq
Copy link
Copy Markdown

codspeed-hq bot commented Dec 11, 2025

CodSpeed Performance Report

Merging #16730 will not alter performance

Comparing no-loss-of-prec (cca5032) with main (afd6c44)1

Summary

✅ 4 untouched
⏩ 41 skipped2

Footnotes

  1. No successful run was found on main (6079d8e) during the generation of this report, so afd6c44 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.

@connorshea connorshea added the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
Copy link
Copy Markdown
Member Author

connorshea commented Dec 11, 2025

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.
@graphite-app graphite-app bot merged commit a2c9d16 into main Dec 11, 2025
20 checks passed
@graphite-app graphite-app bot deleted the no-loss-of-prec branch December 11, 2025 06:10
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-docs Category - Documentation. Related to user-facing or internal documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants