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
~~~~~~

tests/baselines/reference/noImplicitAnyIndexingSuppressed.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error TS5102: Option 'suppressImplicitAnyIndexErrors' has been removed. Please remove it from your configuration.
1+
error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
22
noImplicitAnyIndexingSuppressed.ts(12,37): error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.
33
noImplicitAnyIndexingSuppressed.ts(19,9): error TS2339: Property 'hi' does not exist on type '{}'.
44
noImplicitAnyIndexingSuppressed.ts(22,9): error TS2339: Property '10' does not exist on type '{}'.
55
noImplicitAnyIndexingSuppressed.ts(29,10): error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{}'.
66

77

8-
!!! error TS5102: Option 'suppressImplicitAnyIndexErrors' has been removed. Please remove it from your configuration.
8+
!!! error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
99
==== noImplicitAnyIndexingSuppressed.ts (4 errors) ====
1010
enum MyEmusEnum {
1111
emu
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

33

4-
!!! error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration.
4+
!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
55
==== noImplicitUseStrict_amd.ts (0 errors) ====
66
export var x = 0;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

33

4-
!!! error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration.
4+
!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
55
==== noImplicitUseStrict_commonjs.ts (0 errors) ====
66
export var x = 0;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

33

4-
!!! error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration.
4+
!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
55
==== noImplicitUseStrict_es6.ts (0 errors) ====
66
export var x = 0;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

33

4-
!!! error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration.
4+
!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
55
==== noImplicitUseStrict_system.ts (0 errors) ====
66
export var x = 0;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

33

4-
!!! error TS5102: Option 'noImplicitUseStrict' has been removed. Please remove it from your configuration.
4+
!!! error TS5101: Option 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
55
==== noImplicitUseStrict_umd.ts (0 errors) ====
66
export var x = 0;

tests/baselines/reference/noStrictGenericChecks.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error TS5102: Option 'noStrictGenericChecks' has been removed. Please remove it from your configuration.
1+
error TS5101: Option 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
22
noStrictGenericChecks.ts(5,5): error TS2322: Type 'B' is not assignable to type 'A'.
33
Types of parameters 'y' and 'y' are incompatible.
44
Type 'U' is not assignable to type 'T'.
55
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
66

77

8-
!!! error TS5102: Option 'noStrictGenericChecks' has been removed. Please remove it from your configuration.
8+
!!! error TS5101: Option 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
99
==== noStrictGenericChecks.ts (1 errors) ====
1010
type A = <T, U>(x: T, y: U) => [T, U];
1111
type B = <S>(x: S, y: S) => [S, S];

tests/baselines/reference/nonPrimitiveIndexingWithForInSupressError.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
error TS5102: Option 'suppressImplicitAnyIndexErrors' has been removed. Please remove it from your configuration.
1+
error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
22
nonPrimitiveIndexingWithForInSupressError.ts(4,17): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
33
No index signature with a parameter of type 'string' was found on type '{}'.
44

55

6-
!!! error TS5102: Option 'suppressImplicitAnyIndexErrors' has been removed. Please remove it from your configuration.
6+
!!! error TS5101: Option 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
77
==== nonPrimitiveIndexingWithForInSupressError.ts (1 errors) ====
88
var a: object;
99

tests/baselines/reference/preserveUnusedImports.errors.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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

44

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

0 commit comments

Comments
 (0)