Skip to content

refactor(linter/unicorn/prefer-bigint-literals): unwrap raw field of NumericLiteral - #29914

Merged
graphite-app[bot] merged 1 commit into
mainfrom
om/11-19-refactor_linter_unicorn_prefer-bigint-literals_unwrap_raw_field_of_numericliteral_
Nov 20, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
om/11-19-refactor_linter_unicorn_prefer-bigint-literals_unwrap_raw_field_of_numericliteral_

Conversation

@overlookmotel

@overlookmotel overlookmotel commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

The linter only runs on ASTs produced by the parser, which always sets raw on NumericLiterals. prefer-bigint-literals handled raw being None anyway, with a debug_assert! and a fallback to the source text of the literal's span.

Just unwrap instead. The fallback was useless anyway - integer_literal_loses_precision, called immediately after, already unwraps raw.

overlookmotel commented Nov 20, 2026 •

Copy link
Copy Markdown
Member Author

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 changes, fast-track this PR to the front of 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@codspeed

codspeed Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 5 untouched benchmarks
⏩ 105 skipped benchmarks1


Comparing om/11-19-refactor_linter_unicorn_prefer-bigint-literals_unwrap_raw_field_of_numericliteral_ (49f7cbb) with om/11-20-perf_parser_remove_unnecessary_conversion_when_parsing_bigints (fbe75b5)

Open in CodSpeed

Footnotes

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

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Nov 20, 2026

camc314 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Merge activity

@graphite-app
graphite-app Bot changed the base branch from om/11-20-perf_parser_remove_unnecessary_conversion_when_parsing_bigints to graphite-base/29914 November 20, 2026 09:59
@graphite-app
graphite-app Bot changed the base branch from graphite-base/29914 to main November 20, 2026 10:10
@github-actions github-actions Bot added the A-parser Area - JS/TS parsing and syntax errors, oxc_parser label Nov 20, 2026
…f `NumericLiteral` (#29914)

The linter only runs on ASTs produced by the parser, which always sets `raw` on `NumericLiteral`s. `prefer-bigint-literals` handled `raw` being `None` anyway, with a `debug_assert!` and a fallback to the source text of the literal's span.

Just `unwrap` instead. The fallback was useless anyway - `integer_literal_loses_precision`, called immediately after, already unwraps `raw`.
@graphite-app
graphite-app Bot force-pushed the om/11-19-refactor_linter_unicorn_prefer-bigint-literals_unwrap_raw_field_of_numericliteral_ branch from 49f7cbb to 71133d9 Compare November 20, 2026 10:10
@graphite-app
graphite-app Bot merged commit 71133d9 into main Nov 20, 2026
32 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Nov 20, 2026
@graphite-app
graphite-app Bot deleted the om/11-19-refactor_linter_unicorn_prefer-bigint-literals_unwrap_raw_field_of_numericliteral_ branch November 20, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter (oxlint): rules, config, diagnostics, fixes. Add L-* labels for details A-parser Area - JS/TS parsing and syntax errors, oxc_parser

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants