Skip to content

Rule proposal: prefer-bigint-literal #2700

@fisker

Description

@fisker

Description

Prefer bigint literal over BigInt wrapper.

Examples

// ❌
BigInt('1')

// ✅
1n
// ❌
BigInt(1)

// ✅
1n
// ❌
BigInt(1)

// ✅
1n
// ❌
BigInt(9007199254740993)

// ✅ (No auto fix)
9007199254740992n

Proposed rule name

prefer-bigint-literal

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions