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;