Skip to content

Commit fe19ccf

Browse files
committed
Merge pull request #5368 from Microsoft/convert-diagnostic-text-to-es2015
Convert diagnostic text to es2015
2 parents f431c82 + f99227b commit fe19ccf

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

src/compiler/commandLineParser.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ namespace ts {
7979
"es6": ModuleKind.ES6,
8080
"es2015": ModuleKind.ES2015,
8181
},
82-
description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es6,
82+
description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015,
8383
paramType: Diagnostics.KIND,
84-
error: Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_umd_or_es6
84+
error: Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_umd_or_es2015
8585
},
8686
{
8787
name: "newLine",
@@ -212,9 +212,9 @@ namespace ts {
212212
"es6": ScriptTarget.ES6,
213213
"es2015": ScriptTarget.ES2015,
214214
},
215-
description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental,
215+
description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_experimental,
216216
paramType: Diagnostics.VERSION,
217-
error: Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6
217+
error: Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES2015
218218
},
219219
{
220220
name: "version",

src/compiler/diagnosticMessages.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@
627627
"category": "Error",
628628
"code": 1203
629629
},
630-
"Cannot compile modules into 'es6' when targeting 'ES5' or lower.": {
630+
"Cannot compile modules into 'es2015' when targeting 'ES5' or lower.": {
631631
"category": "Error",
632632
"code": 1204
633633
},
@@ -2044,7 +2044,7 @@
20442044
"category": "Error",
20452045
"code": 5042
20462046
},
2047-
"Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher.": {
2047+
"Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher.": {
20482048
"category": "Error",
20492049
"code": 5047
20502050
},
@@ -2105,11 +2105,11 @@
21052105
"category": "Message",
21062106
"code": 6010
21072107
},
2108-
"Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)": {
2109-
"category": "Message",
2110-
"code": 6015
2111-
},
2112-
"Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es6'": {
2108+
"Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015' (experimental)": {
2109+
"category": "Message",
2110+
"code": 6015
2111+
},
2112+
"Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'": {
21132113
"category": "Message",
21142114
"code": 6016
21152115
},
@@ -2193,14 +2193,14 @@
21932193
"category": "Error",
21942194
"code": 6045
21952195
},
2196-
"Argument for '--module' option must be 'commonjs', 'amd', 'system', 'umd', or 'es6'.": {
2196+
"Argument for '--module' option must be 'commonjs', 'amd', 'system', 'umd', or 'es2015'.": {
21972197
"category": "Error",
21982198
"code": 6046
21992199
},
2200-
"Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'.": {
2201-
"category": "Error",
2202-
"code": 6047
2203-
},
2200+
"Argument for '--target' option must be 'ES3', 'ES5', or 'ES2015'.": {
2201+
"category": "Error",
2202+
"code": 6047
2203+
},
22042204
"Locale must be of the form <language> or <language>-<territory>. For example '{0}' or '{1}'.": {
22052205
"category": "Error",
22062206
"code": 6048

src/compiler/program.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ namespace ts {
10051005
let firstExternalModuleSourceFile = forEach(files, f => isExternalModule(f) ? f : undefined);
10061006
if (options.isolatedModules) {
10071007
if (!options.module && languageVersion < ScriptTarget.ES6) {
1008-
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher));
1008+
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher));
10091009
}
10101010

10111011
let firstNonExternalModuleSourceFile = forEach(files, f => !isExternalModule(f) && !isDeclarationFile(f) ? f : undefined);
@@ -1022,7 +1022,7 @@ namespace ts {
10221022

10231023
// Cannot specify module gen target of es6 when below es6
10241024
if (options.module === ModuleKind.ES6 && languageVersion < ScriptTarget.ES6) {
1025-
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_modules_into_es6_when_targeting_ES5_or_lower));
1025+
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower));
10261026
}
10271027

10281028
// there has to be common source directory if user specified --outdir || --sourceRoot

tests/baselines/reference/es5andes6module.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
error TS1204: Cannot compile modules into 'es6' when targeting 'ES5' or lower.
1+
error TS1204: Cannot compile modules into 'es2015' when targeting 'ES5' or lower.
22

33

4-
!!! error TS1204: Cannot compile modules into 'es6' when targeting 'ES5' or lower.
4+
!!! error TS1204: Cannot compile modules into 'es2015' when targeting 'ES5' or lower.
55
==== tests/cases/compiler/es5andes6module.ts (0 errors) ====
66

77
export default class A
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
error TS5047: Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher.
1+
error TS5047: Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher.
22

33

4-
!!! error TS5047: Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher.
4+
!!! error TS5047: Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher.
55
==== tests/cases/compiler/isolatedModulesUnspecifiedModule.ts (0 errors) ====
66
export var x;

0 commit comments

Comments
 (0)