Skip to content

Commit ecf3789

Browse files
5.5 deprecations are no-ops, not errors (#58313)
1 parent 0c2fd6d commit ecf3789

File tree

52 files changed

+138
-187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+138
-187
lines changed

src/compiler/program.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4569,6 +4569,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
45694569

45704570
function checkDeprecations(
45714571
deprecatedIn: string,
4572+
stopsWorkingIn: string,
45724573
removedIn: string,
45734574
createDiagnostic: (name: string, value: string | undefined, useInstead: string | undefined, message: DiagnosticMessage, ...args: DiagnosticArguments) => void,
45744575
fn: (createDeprecatedDiagnostic: (name: string, value?: string, useInstead?: string) => void) => void,
@@ -4593,10 +4594,10 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
45934594
}
45944595
else {
45954596
if (value === undefined) {
4596-
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn);
4597+
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, stopsWorkingIn, deprecatedIn);
45974598
}
45984599
else {
4599-
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn);
4600+
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, stopsWorkingIn, deprecatedIn);
46004601
}
46014602
}
46024603
});
@@ -4615,7 +4616,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
46154616
}
46164617
}
46174618

4618-
checkDeprecations("5.0", "5.5", createDiagnostic, createDeprecatedDiagnostic => {
4619+
checkDeprecations("5.0", "5.5", "6.0", createDiagnostic, createDeprecatedDiagnostic => {
46194620
if (options.target === ScriptTarget.ES3) {
46204621
createDeprecatedDiagnostic("target", "ES3");
46214622
}
@@ -4654,7 +4655,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
46544655
createDiagnosticForReference(parentFile, index, message, ...args);
46554656
}
46564657

4657-
checkDeprecations("5.0", "5.5", createDiagnostic, createDeprecatedDiagnostic => {
4658+
checkDeprecations("5.0", "5.5", "6.0", createDiagnostic, createDeprecatedDiagnostic => {
46584659
if (ref.prepend) {
46594660
createDeprecatedDiagnostic("prepend");
46604661
}

tests/baselines/reference/alwaysStrictNoImplicitUseStrict.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration.
1+
error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
22
alwaysStrictNoImplicitUseStrict.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode.
33

44

5-
!!! error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration.
5+
!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
66
==== alwaysStrictNoImplicitUseStrict.ts (1 errors) ====
77
module M {
88
export function f() {

tests/baselines/reference/deprecatedCompilerOptions4.errors.txt

Lines changed: 0 additions & 46 deletions
This file was deleted.

tests/baselines/reference/excessPropertyErrorsSuppressed.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error TS5102: Option 'suppressExcessPropertyErrors' has been removed. Please remove it from your configuration.
1+
error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
22
excessPropertyErrorsSuppressed.ts(1,38): error TS2353: Object literal may only specify known properties, and 'b' does not exist in type '{ a: string; }'.
33

44

5-
!!! error TS5102: Option 'suppressExcessPropertyErrors' has been removed. Please remove it from your configuration.
5+
!!! error TS5101: Option 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
66
==== excessPropertyErrorsSuppressed.ts (1 errors) ====
77
var x: { a: string } = { a: "hello", b: 42 }; // No error
88
~

tests/baselines/reference/importsNotUsedAsValues_error.errors.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error TS5102: Option 'importsNotUsedAsValues' has been removed. Please remove it from your configuration.
1+
error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
22
Use 'verbatimModuleSyntax' instead.
33
/e.ts(1,1): error TS6192: All imports in import declaration are unused.
44

55

6-
!!! error TS5102: Option 'importsNotUsedAsValues' has been removed. Please remove it from your configuration.
7-
!!! error TS5102: Use 'verbatimModuleSyntax' instead.
6+
!!! error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
7+
!!! error TS5101: Use 'verbatimModuleSyntax' instead.
88
==== /a.ts (0 errors) ====
99
export default class {}
1010
export class A {}

tests/baselines/reference/isolatedModulesOut.errors.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
error TS5102: Option 'out' has been removed. Please remove it from your configuration.
1+
error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
22
Use 'outFile' instead.
33

44

5-
!!! error TS5102: Option 'out' has been removed. Please remove it from your configuration.
6-
!!! error TS5102: Use 'outFile' instead.
5+
!!! error TS5101: Option 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
6+
!!! error TS5101: Use 'outFile' instead.
77
==== file1.ts (0 errors) ====
88
export var x;
99
==== file2.ts (0 errors) ====

tests/baselines/reference/keyofDoesntContainSymbols.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error TS5102: Option 'keyofStringsOnly' has been removed. Please remove it from your configuration.
1+
error TS5101: Option 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
22
keyofDoesntContainSymbols.ts(11,30): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
33

44

5-
!!! error TS5102: Option 'keyofStringsOnly' has been removed. Please remove it from your configuration.
5+
!!! error TS5101: Option 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
66
==== keyofDoesntContainSymbols.ts (1 errors) ====
77
const sym = Symbol();
88
const num = 0;

tests/baselines/reference/lateBoundConstraintTypeChecksCorrectly.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
error TS5102: Option 'keyofStringsOnly' has been removed. Please remove it from your configuration.
1+
error TS5101: Option 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
22

33

4-
!!! error TS5102: Option 'keyofStringsOnly' has been removed. Please remove it from your configuration.
4+
!!! error TS5101: Option 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
55
==== lateBoundConstraintTypeChecksCorrectly.ts (0 errors) ====
66
declare const fooProp: unique symbol;
77
declare const barProp: unique symbol;

tests/baselines/reference/mappedTypeUnionConstraintInferences.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
error TS5102: Option 'keyofStringsOnly' has been removed. Please remove it from your configuration.
1+
error TS5101: Option 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
22

33

4-
!!! error TS5102: Option 'keyofStringsOnly' has been removed. Please remove it from your configuration.
4+
!!! error TS5101: Option 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
55
==== mappedTypeUnionConstraintInferences.ts (0 errors) ====
66
export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
77
export declare type PartialProperties<T, K extends keyof T> = Partial<Pick<T, K>> & Omit<T, K>;

tests/baselines/reference/noCrashWithVerbatimModuleSyntaxAndImportsNotUsedAsValues.errors.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
error TS5102: Option 'importsNotUsedAsValues' has been removed. Please remove it from your configuration.
2-
Use 'verbatimModuleSyntax' instead.
31
file.ts(1,1): error TS1287: A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled.
42
index.ts(1,9): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled.
53

64

7-
!!! error TS5102: Option 'importsNotUsedAsValues' has been removed. Please remove it from your configuration.
8-
!!! error TS5102: Use 'verbatimModuleSyntax' instead.
95
==== file.ts (1 errors) ====
106
export class A {}
117
~~~~~~

0 commit comments

Comments
 (0)