-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Default target to "latest standard", deprecate ES5
#63067
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
base: main
Are you sure you want to change the base?
Changes from all commits
40ca9d5
3ee4c3f
5de2add
882eef4
6a38824
f6f9faf
ea264aa
b053a30
9a0396c
f40b25c
212085d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,7 +157,7 @@ describe("unittests:: tscWatch:: incremental:: emit file --incremental", () => { | |
| { currentDirectory: project }, | ||
| ); | ||
| const reportDiagnostic = ts.createDiagnosticReporter(system); | ||
| const parsedConfig = ts.parseConfigFileWithSystem("tsconfig.json", {}, /*extendedConfigCache*/ undefined, /*watchOptionsToExtend*/ undefined, system, reportDiagnostic)!; | ||
| const parsedConfig = ts.parseConfigFileWithSystem("tsconfig.json", { target: ts.ScriptTarget.ES5, module: ts.ModuleKind.AMD }, /*extendedConfigCache*/ undefined, /*watchOptionsToExtend*/ undefined, system, reportDiagnostic)!; | ||
| ts.performIncrementalCompilation({ | ||
| rootNames: parsedConfig.fileNames, | ||
| options: parsedConfig.options, | ||
|
|
@@ -167,7 +167,7 @@ describe("unittests:: tscWatch:: incremental:: emit file --incremental", () => { | |
| system, | ||
| }); | ||
|
|
||
| const command = ts.parseConfigFileWithSystem("tsconfig.json", {}, /*extendedConfigCache*/ undefined, /*watchOptionsToExtend*/ undefined, system, ts.noop)!; | ||
| const command = ts.parseConfigFileWithSystem("tsconfig.json", { target: ts.ScriptTarget.ES5, module: ts.ModuleKind.AMD }, /*extendedConfigCache*/ undefined, /*watchOptionsToExtend*/ undefined, system, ts.noop)!; | ||
| const builderProgram = ts.createIncrementalProgram({ | ||
| rootNames: command.fileNames, | ||
| options: command.options, | ||
|
|
@@ -200,6 +200,7 @@ describe("unittests:: tscWatch:: incremental:: emit file --incremental", () => { | |
|
|
||
| assert.deepEqual(builderProgram.state.compilerOptions, { | ||
| incremental: true, | ||
| target: ts.ScriptTarget.ES5, | ||
| module: ts.ModuleKind.AMD, | ||
| configFilePath: config.path, | ||
| ignoreDeprecations: "6.0", | ||
|
|
@@ -242,7 +243,7 @@ describe("unittests:: tscWatch:: incremental:: emit file --incremental", () => { | |
| content: jsonToReadableText({ | ||
| compilerOptions: { | ||
| incremental: true, | ||
| target: "es5", | ||
| target: "es2015", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But so why is this one ES2015?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed most tests that broke to es2015 first, and then flipped things back. In this case I'm sure I did it to avoid a deprecation error that messes up the incremental test. |
||
| module: "commonjs", | ||
| declaration: true, | ||
| emitDeclarationOnly: true, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. | ||
|
|
||
|
|
||
| !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. | ||
| ==== ES3For-ofTypeCheck1.ts (0 errors) ==== | ||
| for (var v of "") { } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. | ||
|
|
||
|
|
||
| !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. | ||
| ==== ES3For-ofTypeCheck2.ts (0 errors) ==== | ||
| for (var v of [true]) { } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. | ||
|
|
||
|
|
||
| !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. | ||
| ==== ES3For-ofTypeCheck4.ts (0 errors) ==== | ||
| var union: string | string[]; | ||
| for (const v of union) { } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. | ||
|
|
||
|
|
||
| !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. | ||
| ==== ES3For-ofTypeCheck6.ts (0 errors) ==== | ||
| var union: string[] | number[]; | ||
| for (var v of union) { } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. | ||
|
|
||
|
|
||
| !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. | ||
| ==== ES5For-of1.ts (0 errors) ==== | ||
| for (var v of ['a', 'b', 'c']) { | ||
| console.log(v); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you're still using ES5 here - are you just doing this to avoid churning baselines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ryan asked me about this one too. Yes, this is to avoid churning baselines.