Skip to content

Latest commit

Β 

History

History
30 lines (20 loc) Β· 816 Bytes

File metadata and controls

30 lines (20 loc) Β· 816 Bytes

prefer-bigint-literals

πŸ“ 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;