From 49e64cb57556a920ddccd21d2028cf5d3fc8a112 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Mon, 6 Mar 2023 00:51:21 +0900 Subject: [PATCH] fix(eslint-plugin): fix printing BigInt literal --- .../src/rules/no-redundant-type-constituents.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/eslint-plugin/src/rules/no-redundant-type-constituents.ts b/packages/eslint-plugin/src/rules/no-redundant-type-constituents.ts index 33237a8ae4e..4e737b996b7 100644 --- a/packages/eslint-plugin/src/rules/no-redundant-type-constituents.ts +++ b/packages/eslint-plugin/src/rules/no-redundant-type-constituents.ts @@ -83,6 +83,12 @@ function describeLiteralType(type: ts.Type): string { } if (type.isLiteral()) { + if (typeof type.value === 'object') { + // Print ts.PseudoBigInt + return `${ + type.value.negative ? '-' : '' + }${type.value.base10Value.toString()}n`; + } return type.value.toString(); }