Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eslint-plugin): Add BigInt object type to default ban-types list #4970

Merged
merged 3 commits into from May 14, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/eslint-plugin/docs/rules/ban-types.md
Expand Up @@ -105,6 +105,10 @@ const defaultTypes = {
message: 'Use symbol instead',
fixWith: 'symbol',
},
BigInt: {
message: 'Use bigint instead',
fixWith: 'bigint',
},

Function: {
message: [
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions packages/eslint-plugin/src/rules/ban-types.ts
Expand Up @@ -66,6 +66,10 @@ const defaultTypes: Types = {
message: 'Use symbol instead',
fixWith: 'symbol',
},
BigInt: {
message: 'Use bigint instead',
fixWith: 'bigint',
},

Function: {
message: [
Expand Down