Skip to content

feat(lint/js): add useBigintLiterals - #11967

Merged
dyc3 merged 2 commits into
mainfrom
dyc3/use-bigint-literals
Oct 2, 2026
Merged

dyc3 merged 2 commits into
mainfrom
dyc3/use-bigint-literals

Conversation

@dyc3

@dyc3 dyc3 commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds useBigintLiterals, which is a port of https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-bigint-literals.md

Test Plan

snapshots

Docs

@changeset-bot

changeset-bot Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 86f8fe1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-win32-x64 Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/wasm-web Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added A-CLI Area: CLI A-Project Area: project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis labels Sep 26, 2026
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: biomejs/biome/.coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: 8fc06f42-cc1c-4b19-98ad-0af5649c4bb5

📥 Commits

Reviewing files that changed from the base of the PR and between 9a82087 and 86f8fe1.

⛔ Files ignored due to path filters (16)
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_configuration/src/generated/linter_options_check.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useBigintLiterals/invalid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useBigintLiterals/invalidComputedMembers.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useBigintLiterals/invalidScript.cjs.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useBigintLiterals/invalidTokenBoundaries.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useBigintLiterals/invalidTokenBoundaries.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useBigintLiterals/invalidUnterminated.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useBigintLiterals/valid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useBigintLiterals/validDigitBoundaries.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useBigintLiterals/validOptional.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useBigintLiterals/validTaggedMembers.js.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (2)
  • crates/biome_js_analyze/src/lint/nursery/use_bigint_literals.rs
  • crates/biome_rule_options/src/lib.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

Adds the useBigintLiterals nursery rule. It reports eligible calls to the unshadowed global BigInt and offers a safe fix that replaces supported numeric or string arguments with bigint literals. The change also adds rule options, test fixtures for matching and exclusion cases, and a patch changeset.

Suggested reviewers: biome-cookie

Priority: ⬇️ Low

Change: Feature

Merge Risk: ⚪ Minimal · up to 86f8f

This change adds a new nursery lint rule, useBigintLiterals, with a safe fix. Nursery rules are not enabled in production presets, and the conversion and safe-fix edge cases have been checked. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding the useBigintLiterals JavaScript lint rule.
Description check ✅ Passed The description explains that the pull request adds useBigintLiterals as a port of the ESLint Unicorn rule and identifies snapshots as the test plan.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@ematipico

Copy link
Copy Markdown
Member

@biome-cookie review

@biome-cookie biome-cookie left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Review complete. No findings.

Review Status

  • Scope: 088164f through dc8319e, 30 files

  • Branch target: main

  • Changeset: present and correct

  • Brief: Added the nursery JS lint rule useBigintLiterals with safe fixes and tests, plus generated registration, migration, and configuration artifacts.

  • Validation: Static review only; no project code was run.

  • Fetch: not needed; head checkout used

@dyc3
dyc3 force-pushed the dyc3/use-bigint-literals branch from dc8319e to 9a82087 Compare September 28, 2026 16:59
@codspeed

codspeed Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 114 untouched benchmarks
⏩ 297 skipped benchmarks1


Comparing dyc3/use-bigint-literals (86f8fe1) with main (1a6fb41)

Open in CodSpeed

Footnotes

  1. 297 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. ↩

@dyc3
dyc3 requested review from a team September 29, 2026 19:20

@Conaclos Conaclos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I left some minor comments/suggestions.

@dyc3
dyc3 force-pushed the dyc3/use-bigint-literals branch from 9a82087 to 5a67d7b Compare October 2, 2026 16:49
@dyc3
dyc3 merged commit 4c1612b into main Oct 2, 2026
35 checks passed
@dyc3
dyc3 deleted the dyc3/use-bigint-literals branch October 2, 2026 17:20
@github-actions github-actions Bot mentioned this pull request Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants