Skip to content

Commit f7ad54b

Browse files
Only complain about BigInt literals in pre-ESNext targets.
1 parent 02ca5be commit f7ad54b

File tree

4 files changed

+2
-20
lines changed

4 files changed

+2
-20
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30528,13 +30528,10 @@ namespace ts {
3052830528
isPrefixUnaryExpression(node.parent) && isLiteralTypeNode(node.parent.parent);
3052930529
if (!literalType) {
3053030530
if (languageVersion < ScriptTarget.ESNext) {
30531-
if (grammarErrorOnNode(node, Diagnostics.BigInt_literals_are_not_available_when_targetting_lower_than_ESNext)) {
30531+
if (grammarErrorOnNode(node, Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ESNext)) {
3053230532
return true;
3053330533
}
3053430534
}
30535-
if (!compilerOptions.experimentalBigInt) {
30536-
return grammarErrorOnNode(node, Diagnostics.Experimental_support_for_BigInt_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalBigInt_option_to_remove_this_warning);
30537-
}
3053830535
}
3053930536
return false;
3054030537
}

src/compiler/commandLineParser.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -584,12 +584,6 @@ namespace ts {
584584
category: Diagnostics.Experimental_Options,
585585
description: Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
586586
},
587-
{
588-
name: "experimentalBigInt",
589-
type: "boolean",
590-
category: Diagnostics.Experimental_Options,
591-
description: Diagnostics.Enables_experimental_support_for_ESNext_BigInt_literals
592-
},
593587

594588
// Advanced
595589
{

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,10 +1011,6 @@
10111011
"category": "Message",
10121012
"code": 1350
10131013
},
1014-
"Experimental support for BigInt is a feature that is subject to change in a future release. Set the 'experimentalBigInt' option to remove this warning.": {
1015-
"category": "Error",
1016-
"code": 1351
1017-
},
10181014

10191015
"Duplicate identifier '{0}'.": {
10201016
"category": "Error",
@@ -2505,7 +2501,7 @@
25052501
"category": "Error",
25062502
"code": 2736
25072503
},
2508-
"BigInt literals are not available when targetting lower than ESNext.": {
2504+
"BigInt literals are not available when targeting lower than ESNext.": {
25092505
"category": "Error",
25102506
"code": 2737
25112507
},
@@ -3921,10 +3917,6 @@
39213917
"category": "Error",
39223918
"code": 6370
39233919
},
3924-
"Enables experimental support for ESNext BigInt literals.": {
3925-
"category": "Message",
3926-
"code": 6371
3927-
},
39283920

39293921
"The expected type comes from property '{0}' which is declared here on type '{1}'": {
39303922
"category": "Message",

src/compiler/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4495,7 +4495,6 @@ namespace ts {
44954495
downlevelIteration?: boolean;
44964496
emitBOM?: boolean;
44974497
emitDecoratorMetadata?: boolean;
4498-
experimentalBigInt?: boolean;
44994498
experimentalDecorators?: boolean;
45004499
forceConsistentCasingInFileNames?: boolean;
45014500
/*@internal*/help?: boolean;

0 commit comments

Comments
 (0)