Skip to content

chore: lint against BigInt literals#73

Merged
ChALkeR merged 2 commits into
mainfrom
chore/lint-no-bigint-literal
May 15, 2026
Merged

chore: lint against BigInt literals#73
ChALkeR merged 2 commits into
mainfrom
chore/lint-no-bigint-literal

Conversation

@exo-mv
Copy link
Copy Markdown
Contributor

@exo-mv exo-mv commented May 15, 2026

depends on #72

Summary

  • Adds no-restricted-syntax: Literal[bigint] to .eslintrc.cjs so new BigInt literals
    (e.g. 1n) cannot land in shipped source.
  • Exempts tests/** and benchmarks/**, which aren't shipped and use literal fixtures freely.

Why

Some runtimes we ship to (notably Hermes) don't parse BigInt literal syntax even though
they support BigInt(n). The exodus-mobile patchset already rewrites such literals
(https://github.com/ExodusMovement/exodus-mobile/blob/main/src/patches-prod/exodus-bytes-
no-bigint-literal.diff). This rule prevents new ones from sneaking in.

Notes

Test plan

  • pnpm run lint passes locally
  • CI green
  • Sanity: temporarily reintroduce a 1n in base58.js → lint errors with the configured message

exo-mv and others added 2 commits May 15, 2026 12:48
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Some runtimes we ship to (notably Hermes) do not support BigInt literal
syntax (`1n`), even though they support `BigInt(1)`. We already have a
downstream patch (`exodus-bytes-no-bigint-literal.diff`) rewriting such
literals; this prevents new ones from sneaking in. Tests and benchmarks
are exempt since they are not shipped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@exo-mv exo-mv requested a review from ChALkeR as a code owner May 15, 2026 17:05
@ChALkeR ChALkeR changed the base branch from chore/base58-32n-const to main May 15, 2026 19:40
@ChALkeR ChALkeR merged commit 47a7791 into main May 15, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants