# Disable BigInt (`ts-compat/no-bigint`) 💼 This rule is enabled in the ✅ `recommended` config. BigInt is an ES2020 feature. It has never been supported by any version of IE or legacy Edge, and it needs Chrome 67, Edge 79, Firefox 68, Safari 14, Opera 54 or iOS Safari 14 to run. It can not be polyfilled. `bigint` is a primitive type, so neither the `1n` syntax nor the `BigInt` function can be rebuilt from values that older engines already have. Use `Number` while the value stays inside `Number.MAX_SAFE_INTEGER`, or keep an arbitrary precision value as a decimal string. ## Rule Details Examples of **incorrect** code for this rule: ```ts const a = 1n; const b = BigInt("12345678901234567890"); const c: bigint = 2n; function d(e: bigint) { return e; } const f = 1 as bigint; const g: (h: bigint) => void = (h) => { console.log(h); }; ``` Examples of **correct** code for this rule: ```ts const a = 1; const b = "12345678901234567890"; const c: number = 2; function d(e: number) { return e; } const f: (h: number) => void = (h) => { console.log(h); }; ``` ## When Not To Use It * Every target browser supports BigInt. * The code runs in an architecture layer, such as a decimal calculation library, and BigInt never reaches an unsupported browser. ## Further Reading * [MDN BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) * [BigInt proposal](https://github.com/tc39/proposal-bigint)