diff --git a/packages/eslint-plugin/docs/rules/ban-types.md b/packages/eslint-plugin/docs/rules/ban-types.md index 0a16559e96f..8f59dd8f60d 100644 --- a/packages/eslint-plugin/docs/rules/ban-types.md +++ b/packages/eslint-plugin/docs/rules/ban-types.md @@ -105,6 +105,10 @@ const defaultTypes = { message: 'Use symbol instead', fixWith: 'symbol', }, + BigInt: { + message: 'Use bigint instead', + fixWith: 'bigint', + }, Function: { message: [ @@ -149,6 +153,7 @@ const str: String = 'foo'; const bool: Boolean = true; const num: Number = 1; const symb: Symbol = Symbol('foo'); +const bigInt: BigInt = 1n; // use a proper function type const func: Function = () => 1; @@ -169,6 +174,7 @@ const str: string = 'foo'; const bool: boolean = true; const num: number = 1; const symb: symbol = Symbol('foo'); +const bigInt: bigint = 1n; // use a proper function type const func: () => number = () => 1; diff --git a/packages/eslint-plugin/src/rules/ban-types.ts b/packages/eslint-plugin/src/rules/ban-types.ts index 38224b15ce9..00279a7db0c 100644 --- a/packages/eslint-plugin/src/rules/ban-types.ts +++ b/packages/eslint-plugin/src/rules/ban-types.ts @@ -66,6 +66,10 @@ const defaultTypes: Types = { message: 'Use symbol instead', fixWith: 'symbol', }, + BigInt: { + message: 'Use bigint instead', + fixWith: 'bigint', + }, Function: { message: [