prefer-bigint-literals

March 27, 2026 ยท View on GitHub

๐Ÿ“ Prefer BigInt literals over the constructor.

๐Ÿ’ผ This rule is enabled in the following configs: โœ… recommended, โ˜‘๏ธ unopinionated.

๐Ÿ”ง๐Ÿ’ก This rule is automatically fixable by the --fix CLI option and manually fixable by editor suggestions.

Use 1n instead of BigInt(1).

Examples

// โŒ
const bigint = BigInt(1);

// โœ…
const bigint = 1n;
// โŒ
const bigint = BigInt('1');

// โœ…
const bigint = 1n;