feat(51000) - Flag Deprecation Plan (#51424)

* feat(51000): add ignoreDeprecations option

* use constants of versions

* change the ignoreDeprecations type to allow only one value - '5.0'

* add tests

* update baseline

* add typeScriptVersion to CreateProgramOptions

* update baseline

* change diagnostic message
This commit is contained in:
Oleksandr T authored and GitHub committed 2022-12-15 10:44:06 -08:00
1 parent e0bfac531b
commit fe185272cf
518 files changed
+6322 -95

No files matched your search

+6 -1
View File
@@ -1510,7 +1510,12 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
description: Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
category: Diagnostics.Language_and_Environment,
defaultValueDescription: Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
}
},
{
name: "ignoreDeprecations",
type: "string",
defaultValueDescription: undefined,
},
];
/** @internal */
+12
View File
@@ -4245,6 +4245,18 @@
"category": "Error",
"code": 5100
},
"Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify 'ignoreDeprecations: \"{2}\"' to silence this error.": {
"category": "Error",
"code": 5101
},
"Flag '{0}' is deprecated. Please remove it from your configuration.": {
"category": "Error",
"code": 5102
},
"Invalid value for '--ignoreDeprecations'.": {
"category": "Error",
"code": 5103
},
"Generates a sourcemap for each corresponding '.d.ts' file.": {
"category": "Message",
+54 -3
View File
@@ -53,6 +53,7 @@ import {
CustomTransformers,
Debug,
DeclarationWithTypeParameterChildren,
DeprecationVersion,
Diagnostic,
DiagnosticCategory,
diagnosticCategoryName,
@@ -308,6 +309,7 @@ import {
UnparsedSource,
VariableDeclaration,
VariableStatement,
versionMajorMinor,
walkUpParenthesizedExpressions,
WriteFileCallback,
WriteFileCallbackData,
@@ -1392,13 +1394,14 @@ function shouldProgramCreateNewSourceFiles(program: Program | undefined, newOpti
return optionsHaveChanges(program.getCompilerOptions(), newOptions, sourceFileAffectingCompilerOptions);
}
function createCreateProgramOptions(rootNames: readonly string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: readonly Diagnostic[]): CreateProgramOptions {
function createCreateProgramOptions(rootNames: readonly string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: readonly Diagnostic[], typeScriptVersion?: string): CreateProgramOptions {
return {
rootNames,
options,
host,
oldProgram,
configFileParsingDiagnostics
configFileParsingDiagnostics,
typeScriptVersion,
};
}
@@ -1430,7 +1433,7 @@ export function createProgram(createProgramOptions: CreateProgramOptions): Progr
export function createProgram(rootNames: readonly string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: readonly Diagnostic[]): Program;
export function createProgram(rootNamesOrOptions: readonly string[] | CreateProgramOptions, _options?: CompilerOptions, _host?: CompilerHost, _oldProgram?: Program, _configFileParsingDiagnostics?: readonly Diagnostic[]): Program {
const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options!, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; // TODO: GH#18217
const { rootNames, options, configFileParsingDiagnostics, projectReferences } = createProgramOptions;
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion } = createProgramOptions;
let { oldProgram } = createProgramOptions;
let processingDefaultLibFiles: SourceFile[] | undefined;
@@ -3989,6 +3992,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
}
verifyDeprecatedCompilerOptions();
verifyProjectReferences();
// List of collected files is complete; validate exhautiveness if this is a project with a file list
@@ -4264,6 +4268,53 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
}
}
function verifyDeprecatedCompilerOptions() {
const version = typeScriptVersion || versionMajorMinor;
const ignoreDeprecations = options.ignoreDeprecations;
if (ignoreDeprecations) {
if (ignoreDeprecations === DeprecationVersion.v5_0 && (version === DeprecationVersion.v5_0 || version === DeprecationVersion.v5_5)) {
return;
}
else {
createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations);
}
}
if (options.target === ScriptTarget.ES3) {
createDeprecatedDiagnosticForOption(version, "target", "ES3");
}
if (options.noImplicitUseStrict) {
createDeprecatedDiagnosticForOption(version, "noImplicitUseStrict");
}
if (options.keyofStringsOnly) {
createDeprecatedDiagnosticForOption(version, "keyofStringsOnly");
}
if (options.suppressExcessPropertyErrors) {
createDeprecatedDiagnosticForOption(version, "suppressExcessPropertyErrors");
}
if (options.suppressImplicitAnyIndexErrors) {
createDeprecatedDiagnosticForOption(version, "suppressImplicitAnyIndexErrors");
}
if (options.noStrictGenericChecks) {
createDeprecatedDiagnosticForOption(version, "noStrictGenericChecks");
}
if (options.charset) {
createDeprecatedDiagnosticForOption(version, "charset");
}
if (options.out) {
createDeprecatedDiagnosticForOption(version, "out");
}
}
function createDeprecatedDiagnosticForOption(version: string, name: string, value?: string) {
if (version === DeprecationVersion.v6_0) {
createDiagnosticForOption(/*onKey*/ !value, name, /*option2*/ undefined, Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name);
}
else {
createDiagnosticForOption(/*onKey*/ !value, name, /*option2*/ undefined,
Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, DeprecationVersion.v5_5, DeprecationVersion.v5_0);
}
}
function createDiagnosticExplainingFile(file: SourceFile | undefined, fileProcessingReason: FileIncludeReason | undefined, diagnostic: DiagnosticMessage, args: (string | number | undefined)[] | undefined): Diagnostic {
let fileIncludeReasons: DiagnosticMessageChain[] | undefined;
let relatedInfo: Diagnostic[] | undefined;
+12
View File
@@ -7015,6 +7015,7 @@ export interface CompilerOptions {
/** @internal */generateCpuProfile?: string;
/** @internal */generateTrace?: string;
/** @internal */help?: boolean;
ignoreDeprecations?: string;
importHelpers?: boolean;
importsNotUsedAsValues?: ImportsNotUsedAsValues;
/** @internal */init?: boolean;
@@ -7272,6 +7273,8 @@ export interface CreateProgramOptions {
host?: CompilerHost;
oldProgram?: Program;
configFileParsingDiagnostics?: readonly Diagnostic[];
/** @internal */
typeScriptVersion?: string;
}
/** @internal */
@@ -9782,3 +9785,12 @@ export interface Queue<T> {
dequeue(): T;
isEmpty(): boolean;
}
/** @internal */
export const enum DeprecationVersion {
/* eslint-disable @typescript-eslint/naming-convention */
v5_0 = "5.0",
v5_5 = "5.5",
v6_0 = "6.0",
/* eslint-enable @typescript-eslint/naming-convention */
}
+3 -4
View File
@@ -241,7 +241,7 @@ export class CompilationResult {
}
}
export function compileFiles(host: fakes.CompilerHost, rootFiles: string[] | undefined, compilerOptions: ts.CompilerOptions): CompilationResult {
export function compileFiles(host: fakes.CompilerHost, rootFiles: string[] | undefined, compilerOptions: ts.CompilerOptions, typeScriptVersion?: string): CompilationResult {
if (compilerOptions.project || !rootFiles || rootFiles.length === 0) {
const project = readProject(host.parseConfigHost, compilerOptions.project, compilerOptions);
if (project) {
@@ -265,11 +265,10 @@ export function compileFiles(host: fakes.CompilerHost, rootFiles: string[] | und
// pre-emit/post-emit error comparison requires declaration emit twice, which can be slow. If it's unlikely to flag any error consistency issues
// and if the test is running `skipLibCheck` - an indicator that we want the tets to run quickly - skip the before/after error comparison, too
const skipErrorComparison = ts.length(rootFiles) >= 100 || (!!compilerOptions.skipLibCheck && !!compilerOptions.declaration);
const preProgram = !skipErrorComparison ? ts.createProgram(rootFiles || [], { ...compilerOptions, configFile: compilerOptions.configFile, traceResolution: false }, host) : undefined;
const preProgram = !skipErrorComparison ? ts.createProgram({ rootNames: rootFiles || [], options: { ...compilerOptions, configFile: compilerOptions.configFile, traceResolution: false }, host, typeScriptVersion }) : undefined;
const preErrors = preProgram && ts.getPreEmitDiagnostics(preProgram);
const program = ts.createProgram(rootFiles || [], compilerOptions, host);
const program = ts.createProgram({ rootNames: rootFiles || [], options: compilerOptions, host, typeScriptVersion });
const emitResult = program.emit();
const postErrors = ts.getPreEmitDiagnostics(program);
const longerErrors = ts.length(preErrors) > postErrors.length ? preErrors : postErrors;
+9 -1
View File
@@ -350,6 +350,9 @@ export namespace Compiler {
if (value === undefined) {
throw new Error(`Cannot have undefined value for compiler option '${name}'.`);
}
if (name === "typeScriptVersion") {
continue;
}
const option = getCommandLineOption(name);
if (option) {
const errors: ts.Diagnostic[] = [];
@@ -412,9 +415,14 @@ export namespace Compiler {
currentDirectory = vfs.srcFolder;
}
let typeScriptVersion: string | undefined;
// Parse settings
if (harnessSettings) {
setCompilerOptionsFromHarnessSetting(harnessSettings, options);
if (ts.isString(harnessSettings.typeScriptVersion) && harnessSettings.typeScriptVersion) {
typeScriptVersion = harnessSettings.typeScriptVersion;
}
}
if (options.rootDirs) {
options.rootDirs = ts.map(options.rootDirs, d => ts.getNormalizedAbsolutePath(d, currentDirectory));
@@ -442,7 +450,7 @@ export namespace Compiler {
fs.apply(symlinks);
}
const host = new fakes.CompilerHost(fs, options);
const result = compiler.compileFiles(host, programFileNames, options);
const result = compiler.compileFiles(host, programFileNames, options, typeScriptVersion);
result.symlinks = symlinks;
return result;
}
@@ -1,6 +1,8 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck1.ts(1,15): error TS2494: Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck1.ts (1 errors) ====
for (var v of "") { }
~~
@@ -0,0 +1,6 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck2.ts (0 errors) ====
for (var v of [true]) { }
@@ -1,6 +1,8 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck4.ts(2,17): error TS2494: Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck4.ts (1 errors) ====
var union: string | string[];
for (const v of union) { }
@@ -0,0 +1,7 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck6.ts (0 errors) ====
var union: string[] | number[];
for (var v of union) { }
@@ -1,9 +1,11 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(10,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(19,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts (4 errors) ====
// error to use accessors in ES3 mode
@@ -1,7 +1,9 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/compiler/accessorsNotAllowedInES3.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/accessorsNotAllowedInES3.ts(4,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/accessorsNotAllowedInES3.ts (2 errors) ====
class C {
get x(): number { return 1; }
@@ -1,8 +1,10 @@
error TS5053: Option 'noImplicitUseStrict' cannot be specified with option 'alwaysStrict'.
error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/compiler/alwaysStrictNoImplicitUseStrict.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode.
!!! error TS5053: Option 'noImplicitUseStrict' cannot be specified with option 'alwaysStrict'.
!!! error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/alwaysStrictNoImplicitUseStrict.ts (1 errors) ====
module M {
export function f() {
@@ -0,0 +1,19 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/ambientAccessors.ts (0 errors) ====
// ok to use accessors in ambient class in ES3
declare class C {
static get a(): string;
static set a(value: string);
private static get b(): string;
private static set b(foo: string);
get x(): string;
set x(value: string);
private get y(): string;
private set y(foo: string);
}
@@ -0,0 +1,24 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/Class.ts (0 errors) ====
import { Configurable } from "./Configurable"
export class HiddenClass {}
export class ActualClass extends Configurable(HiddenClass) {}
==== tests/cases/compiler/Configurable.ts (0 errors) ====
export type Constructor<T> = {
new(...args: any[]): T;
}
export function Configurable<T extends Constructor<{}>>(base: T): T {
return class extends base {
constructor(...args: any[]) {
super(...args);
}
};
}
+1
View File
@@ -7056,6 +7056,7 @@ declare namespace ts {
exactOptionalPropertyTypes?: boolean;
experimentalDecorators?: boolean;
forceConsistentCasingInFileNames?: boolean;
ignoreDeprecations?: string;
importHelpers?: boolean;
importsNotUsedAsValues?: ImportsNotUsedAsValues;
inlineSourceMap?: boolean;
+1
View File
@@ -3121,6 +3121,7 @@ declare namespace ts {
exactOptionalPropertyTypes?: boolean;
experimentalDecorators?: boolean;
forceConsistentCasingInFileNames?: boolean;
ignoreDeprecations?: string;
importHelpers?: boolean;
importsNotUsedAsValues?: ImportsNotUsedAsValues;
inlineSourceMap?: boolean;
@@ -1,9 +1,11 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/compiler/bigIntWithTargetES3.ts(5,22): error TS2737: BigInt literals are not available when targeting lower than ES2020.
tests/cases/compiler/bigIntWithTargetES3.ts(5,29): error TS2737: BigInt literals are not available when targeting lower than ES2020.
tests/cases/compiler/bigIntWithTargetES3.ts(5,39): error TS2737: BigInt literals are not available when targeting lower than ES2020.
tests/cases/compiler/bigIntWithTargetES3.ts(5,48): error TS2737: BigInt literals are not available when targeting lower than ES2020.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/bigIntWithTargetES3.ts (4 errors) ====
const normalNumber = 123; // should not error
let bigintType: bigint; // should not error
@@ -1,8 +1,10 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/compiler/weird.js(1,1): error TS2552: Cannot find name 'someFunction'. Did you mean 'Function'?
tests/cases/compiler/weird.js(1,23): error TS7006: Parameter 'BaseClass' implicitly has an 'any' type.
tests/cases/compiler/weird.js(9,17): error TS7006: Parameter 'error' implicitly has an 'any' type.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/weird.js (3 errors) ====
someFunction(function(BaseClass) {
~~~~~~~~~~~~
@@ -0,0 +1,26 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/jsdoc/returns.js (0 errors) ====
// @ts-check
/**
* @returns {string} This comment is not currently exposed
*/
function f() {
return "hello";
}
/**
* @returns {string=} This comment is not currently exposed
*/
function f1() {
return "hello world";
}
/**
* @returns {string|number} This comment is not currently exposed
*/
function f2() {
return 5 || "hello";
}
@@ -1,8 +1,10 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/conformance/jsdoc/returns.js(6,5): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/jsdoc/returns.js(13,5): error TS2322: Type 'number | boolean' is not assignable to type 'string | number'.
Type 'boolean' is not assignable to type 'string | number'.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/jsdoc/returns.js (2 errors) ====
// @ts-check
/**
@@ -0,0 +1,8 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}
@@ -0,0 +1,13 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames52.js (0 errors) ====
const array = [];
for (let i = 0; i < 10; ++i) {
array.push(class C {
[i] = () => C;
static [i] = 100;
})
}
@@ -0,0 +1,13 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames52.js (0 errors) ====
const array = [];
for (let i = 0; i < 10; ++i) {
array.push(class C {
[i] = () => C;
static [i] = 100;
})
}
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"ignoreDeprecations": "someString"
}
}
@@ -1,6 +1,8 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/compiler/file1.ts(1,1): error TS2448: Block-scoped variable 'c' used before its declaration.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/file1.ts (1 errors) ====
c;
~
@@ -0,0 +1,109 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/controlFlowJavascript.js (0 errors) ====
let cond = true;
// CFA for 'let' and no initializer
function f1() {
let x;
if (cond) {
x = 1;
}
if (cond) {
x = "hello";
}
const y = x; // string | number | undefined
}
// CFA for 'let' and 'undefined' initializer
function f2() {
let x = undefined;
if (cond) {
x = 1;
}
if (cond) {
x = "hello";
}
const y = x; // string | number | undefined
}
// CFA for 'let' and 'null' initializer
function f3() {
let x = null;
if (cond) {
x = 1;
}
if (cond) {
x = "hello";
}
const y = x; // string | number | null
}
// CFA for 'var' with no initializer
function f5() {
var x;
if (cond) {
x = 1;
}
if (cond) {
x = "hello";
}
const y = x; // string | number | undefined
}
// CFA for 'var' with 'undefined' initializer
function f6() {
var x = undefined;
if (cond) {
x = 1;
}
if (cond) {
x = "hello";
}
const y = x; // string | number | undefined
}
// CFA for 'var' with 'null' initializer
function f7() {
var x = null;
if (cond) {
x = 1;
}
if (cond) {
x = "hello";
}
const y = x; // string | number | null
}
// No CFA for captured outer variables
function f9() {
let x;
if (cond) {
x = 1;
}
if (cond) {
x = "hello";
}
const y = x; // string | number | undefined
function f() {
const z = x; // any
}
}
// No CFA for captured outer variables
function f10() {
let x;
if (cond) {
x = 1;
}
if (cond) {
x = "hello";
}
const y = x; // string | number | undefined
const f = () => {
const z = x; // any
};
}
@@ -1,9 +1,11 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/compiler/declFile.d.ts(2,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
tests/cases/compiler/declFile.d.ts(3,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
tests/cases/compiler/declFile.d.ts(5,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
tests/cases/compiler/declFile.d.ts(7,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/client.ts (0 errors) ====
///<reference path="declFile.d.ts"/>
var x = new M.C(); // Declaration file wont get emitted because there are errors in declaration file
@@ -1,9 +1,11 @@
error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file.
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file.
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/out.d.ts (0 errors) ====
declare class c {
}
@@ -1,7 +1,9 @@
error TS5048: Option 'useDefineForClassFields' cannot be specified when option 'target' is 'ES3'.
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5048: Option 'useDefineForClassFields' cannot be specified when option 'target' is 'ES3'.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/classes/propertyMemberDeclarations/definePropertyOutputES3.ts (0 errors) ====
class A {
a = 12
@@ -0,0 +1,43 @@
/foo/tsconfig.json(3,19): error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
/foo/tsconfig.json(4,9): error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
/foo/tsconfig.json(5,9): error TS5101: Flag 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
/foo/tsconfig.json(6,9): error TS5101: Flag 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
/foo/tsconfig.json(7,9): error TS5101: Flag 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
/foo/tsconfig.json(8,9): error TS5101: Flag 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
/foo/tsconfig.json(9,9): error TS5101: Flag 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
/foo/tsconfig.json(10,9): error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== /foo/tsconfig.json (8 errors) ====
{
"compilerOptions": {
"target": "ES3",
~~~~~
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
"noImplicitUseStrict": true,
~~~~~~~~~~~~~~~~~~~~~
!!! error TS5101: Flag 'noImplicitUseStrict' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
"keyofStringsOnly": true,
~~~~~~~~~~~~~~~~~~
!!! error TS5101: Flag 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
"suppressExcessPropertyErrors": true,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS5101: Flag 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
"suppressImplicitAnyIndexErrors": true,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS5101: Flag 'suppressImplicitAnyIndexErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
"noStrictGenericChecks": true,
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS5101: Flag 'noStrictGenericChecks' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
"charset": "utf8",
~~~~~~~~~
!!! error TS5101: Flag 'charset' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
"out": "dist.js"
~~~~~
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
}
}
==== /foo/a.ts (0 errors) ====
const a = 1;
@@ -0,0 +1,6 @@
//// [a.ts]
const a = 1;
//// [dist.js]
var a = 1;
@@ -0,0 +1,4 @@
=== /foo/a.ts ===
const a = 1;
>a : Symbol(a, Decl(a.ts, 0, 5))
@@ -0,0 +1,5 @@
=== /foo/a.ts ===
const a = 1;
>a : 1
>1 : 1
@@ -0,0 +1,6 @@
//// [a.ts]
const a = 1;
//// [dist.js]
var a = 1;
@@ -0,0 +1,4 @@
=== /foo/a.ts ===
const a = 1;
>a : Symbol(a, Decl(a.ts, 0, 5))
@@ -0,0 +1,5 @@
=== /foo/a.ts ===
const a = 1;
>a : 1
>1 : 1
@@ -0,0 +1,43 @@
/foo/tsconfig.json(3,19): error TS5102: Flag 'ES3' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(4,9): error TS5102: Flag 'noImplicitUseStrict' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(5,9): error TS5102: Flag 'keyofStringsOnly' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(6,9): error TS5102: Flag 'suppressExcessPropertyErrors' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(7,9): error TS5102: Flag 'suppressImplicitAnyIndexErrors' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(8,9): error TS5102: Flag 'noStrictGenericChecks' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(9,9): error TS5102: Flag 'charset' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(10,9): error TS5102: Flag 'out' is deprecated. Please remove it from your configuration.
==== /foo/tsconfig.json (8 errors) ====
{
"compilerOptions": {
"target": "ES3",
~~~~~
!!! error TS5102: Flag 'ES3' is deprecated. Please remove it from your configuration.
"noImplicitUseStrict": true,
~~~~~~~~~~~~~~~~~~~~~
!!! error TS5102: Flag 'noImplicitUseStrict' is deprecated. Please remove it from your configuration.
"keyofStringsOnly": true,
~~~~~~~~~~~~~~~~~~
!!! error TS5102: Flag 'keyofStringsOnly' is deprecated. Please remove it from your configuration.
"suppressExcessPropertyErrors": true,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS5102: Flag 'suppressExcessPropertyErrors' is deprecated. Please remove it from your configuration.
"suppressImplicitAnyIndexErrors": true,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS5102: Flag 'suppressImplicitAnyIndexErrors' is deprecated. Please remove it from your configuration.
"noStrictGenericChecks": true,
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS5102: Flag 'noStrictGenericChecks' is deprecated. Please remove it from your configuration.
"charset": "utf8",
~~~~~~~~~
!!! error TS5102: Flag 'charset' is deprecated. Please remove it from your configuration.
"out": "dist.js",
~~~~~
!!! error TS5102: Flag 'out' is deprecated. Please remove it from your configuration.
}
}
==== /foo/a.ts (0 errors) ====
const a = 1;
@@ -0,0 +1,6 @@
//// [a.ts]
const a = 1;
//// [dist.js]
var a = 1;
@@ -0,0 +1,4 @@
=== /foo/a.ts ===
const a = 1;
>a : Symbol(a, Decl(a.ts, 0, 5))
@@ -0,0 +1,5 @@
=== /foo/a.ts ===
const a = 1;
>a : 1
>1 : 1
@@ -0,0 +1,6 @@
//// [a.ts]
const a = 1;
//// [dist.js]
var a = 1;
@@ -0,0 +1,4 @@
=== /foo/a.ts ===
const a = 1;
>a : Symbol(a, Decl(a.ts, 0, 5))
@@ -0,0 +1,5 @@
=== /foo/a.ts ===
const a = 1;
>a : 1
>1 : 1
@@ -0,0 +1,47 @@
/foo/tsconfig.json(3,19): error TS5102: Flag 'ES3' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(4,9): error TS5102: Flag 'noImplicitUseStrict' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(5,9): error TS5102: Flag 'keyofStringsOnly' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(6,9): error TS5102: Flag 'suppressExcessPropertyErrors' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(7,9): error TS5102: Flag 'suppressImplicitAnyIndexErrors' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(8,9): error TS5102: Flag 'noStrictGenericChecks' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(9,9): error TS5102: Flag 'charset' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(10,9): error TS5102: Flag 'out' is deprecated. Please remove it from your configuration.
/foo/tsconfig.json(11,31): error TS5103: Invalid value for '--ignoreDeprecations'.
==== /foo/tsconfig.json (9 errors) ====
{
"compilerOptions": {
"target": "ES3",
~~~~~
!!! error TS5102: Flag 'ES3' is deprecated. Please remove it from your configuration.
"noImplicitUseStrict": true,
~~~~~~~~~~~~~~~~~~~~~
!!! error TS5102: Flag 'noImplicitUseStrict' is deprecated. Please remove it from your configuration.
"keyofStringsOnly": true,
~~~~~~~~~~~~~~~~~~
!!! error TS5102: Flag 'keyofStringsOnly' is deprecated. Please remove it from your configuration.
"suppressExcessPropertyErrors": true,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS5102: Flag 'suppressExcessPropertyErrors' is deprecated. Please remove it from your configuration.
"suppressImplicitAnyIndexErrors": true,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS5102: Flag 'suppressImplicitAnyIndexErrors' is deprecated. Please remove it from your configuration.
"noStrictGenericChecks": true,
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS5102: Flag 'noStrictGenericChecks' is deprecated. Please remove it from your configuration.
"charset": "utf8",
~~~~~~~~~
!!! error TS5102: Flag 'charset' is deprecated. Please remove it from your configuration.
"out": "dist.js",
~~~~~
!!! error TS5102: Flag 'out' is deprecated. Please remove it from your configuration.
"ignoreDeprecations": "5.0"
~~~~~
!!! error TS5103: Invalid value for '--ignoreDeprecations'.
}
}
==== /foo/a.ts (0 errors) ====
const a = 1;
@@ -0,0 +1,6 @@
//// [a.ts]
const a = 1;
//// [dist.js]
var a = 1;
@@ -0,0 +1,4 @@
=== /foo/a.ts ===
const a = 1;
>a : Symbol(a, Decl(a.ts, 0, 5))
@@ -0,0 +1,5 @@
=== /foo/a.ts ===
const a = 1;
>a : 1
>1 : 1
@@ -0,0 +1,8 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.js (0 errors) ====
function foo(name) {
var s = require("t/" + name)
}
@@ -0,0 +1,6 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/emptyFile-declaration.ts (0 errors) ====
@@ -0,0 +1,6 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/emptyFile-souremap.ts (0 errors) ====
@@ -0,0 +1,17 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/es3-amd.ts (0 errors) ====
class A
{
constructor ()
{
}
public B()
{
return 42;
}
}
@@ -0,0 +1,17 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/es3-declaration-amd.ts (0 errors) ====
class A
{
constructor ()
{
}
public B()
{
return 42;
}
}
@@ -0,0 +1,10 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/es3-jsx-preserve.tsx (0 errors) ====
const React: any = null;
const elem = <div></div>;
@@ -4,8 +4,8 @@ const React: any = null;
>null : null
const elem = <div></div>;
>elem : error
><div></div> : error
>elem : any
><div></div> : any
>div : any
>div : any
@@ -0,0 +1,10 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/es3-jsx-react-native.tsx (0 errors) ====
const React: any = null;
const elem = <div></div>;
@@ -4,8 +4,8 @@ const React: any = null;
>null : null
const elem = <div></div>;
>elem : error
><div></div> : error
>elem : any
><div></div> : any
>div : any
>div : any
@@ -0,0 +1,10 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/es3-jsx-react.tsx (0 errors) ====
const React: any = null;
const elem = <div></div>;
@@ -4,8 +4,8 @@ const React: any = null;
>null : null
const elem = <div></div>;
>elem : error
><div></div> : error
>elem : any
><div></div> : any
>div : any
>div : any
@@ -1,7 +1,9 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/compiler/es3-oldStyleOctalLiteralInEnums.ts(2,7): error TS8018: Octal literals are not allowed in enums members initializer. Use the syntax '-0o1'.
tests/cases/compiler/es3-oldStyleOctalLiteralInEnums.ts(3,7): error TS8018: Octal literals are not allowed in enums members initializer. Use the syntax '0o2'.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/es3-oldStyleOctalLiteralInEnums.ts (2 errors) ====
enum E {
x = -01,
@@ -1,7 +1,9 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/compiler/es3-oldStyleOctalLiteralTypes.ts(1,8): error TS8017: Octal literal types must use ES2015 syntax. Use the syntax '0o10'.
tests/cases/compiler/es3-oldStyleOctalLiteralTypes.ts(2,8): error TS8017: Octal literal types must use ES2015 syntax. Use the syntax '-0o20'.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/es3-oldStyleOctalLiteralTypes.ts (2 errors) ====
let x: 010;
~~~
@@ -0,0 +1,17 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/es3-sourcemap-amd.ts (0 errors) ====
class A
{
constructor ()
{
}
public B()
{
return 42;
}
}
@@ -0,0 +1,16 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/es3defaultAliasQuoted_file0.ts (0 errors) ====
export class Foo {
static CONSTANT = "Foo";
}
export default function assert(value: boolean) {
if (!value) throw new Error("Assertion failed!");
}
==== tests/cases/compiler/es3defaultAliasQuoted_file1.ts (0 errors) ====
import {Foo, default as assert} from "./es3defaultAliasQuoted_file0";
assert(Foo.CONSTANT === "Foo");
@@ -0,0 +1,15 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/fs.d.ts (0 errors) ====
export const x: number;
==== tests/cases/compiler/mjts.ts (0 errors) ====
import * as fs from "./fs";
fs;
export * from "./fs";
export {x} from "./fs";
export {x as y} from "./fs";
@@ -0,0 +1,7 @@
error TS5101: Flag 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'suppressExcessPropertyErrors' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/excessPropertyErrorsSuppressed.ts (0 errors) ====
var x: { a: string } = { a: "hello", b: 42 }; // No error
@@ -0,0 +1,14 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/es6/modules/m1.ts (0 errors) ====
export default function f1() {
}
==== tests/cases/conformance/es6/modules/m2.ts (0 errors) ====
import f1 from "./m1";
export default function f2() {
f1();
}
@@ -0,0 +1,14 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/es6/modules/m1.ts (0 errors) ====
export default function f1() {
}
==== tests/cases/conformance/es6/modules/m2.ts (0 errors) ====
import f1 from "./m1";
export default function f2() {
f1();
}
@@ -1,8 +1,10 @@
error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile01.js' because it would overwrite input file.
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile01.js' because it would overwrite input file.
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/salsa/myFile01.js (0 errors) ====
export default "hello";
@@ -1,6 +1,8 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/conformance/es6/modules/m1.ts(5,5): error TS1005: ',' expected.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/es6/modules/m1.ts (1 errors) ====
var R: any
export default R = {
@@ -0,0 +1,15 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/es6/modules/m1.ts (0 errors) ====
var R: any
export default R = {
"__esmodule": true,
"__proto__": {}
}
==== tests/cases/conformance/es6/modules/m2.ts (0 errors) ====
import R from "./m1";
const { __esmodule, __proto__ } = R;
@@ -0,0 +1,16 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/es6/modules/m1.ts (0 errors) ====
var R: any
export default R = {
"___": 30,
"___hello": 21,
"_hi": 40,
}
==== tests/cases/conformance/es6/modules/m2.ts (0 errors) ====
import R from "./m1";
const { ___, ___hello, _hi } = R;
@@ -0,0 +1,36 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/es6/modules/m1.ts (0 errors) ====
declare var console: any;
export function _() {
console.log("_");
}
export function __() {
console.log("__");
}
export function ___() {
console.log("___");
}
export function _hi() {
console.log("_hi");
}
export function __proto() {
console.log("__proto");
}
export function __esmodule() {
console.log("__esmodule");
}
export function ___hello(){
console.log("___hello");
}
==== tests/cases/conformance/es6/modules/m2.ts (0 errors) ====
import {_, __, ___hello, __esmodule, __proto, _hi} from "./m1";
_();
__();
___hello();
__esmodule();
__proto();
_hi();
@@ -0,0 +1,12 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.ts (0 errors) ====
export class c {
}
==== tests/cases/compiler/b.ts (0 errors) ====
function foo() {
}
@@ -0,0 +1,28 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/classes/members/classTypes/genericSetterInClassTypeJsDoc.js (0 errors) ====
/**
* @template T
*/
class Box {
#value;
/** @param {T} initialValue */
constructor(initialValue) {
this.#value = initialValue;
}
/** @type {T} */
get value() {
return this.#value;
}
set value(value) {
this.#value = value;
}
}
new Box(3).value = 3;
@@ -1,9 +1,11 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/conformance/es2019/actual.ts(12,5): error TS2339: Property 'a' does not exist on type 'Window'.
tests/cases/conformance/es2019/actual.ts(13,5): error TS2339: Property 'b' does not exist on type 'Window'.
tests/cases/conformance/es2019/b.js(12,5): error TS2339: Property 'a' does not exist on type 'Window'.
tests/cases/conformance/es2019/b.js(13,5): error TS2339: Property 'b' does not exist on type 'Window'.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/es2019/b.js (2 errors) ====
var a = 10;
this.a;
@@ -0,0 +1,33 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/dynamicImport/test.ts (0 errors) ====
export async function fn() {
const req = await import('./test') // ONE
}
export class cl1 {
public async m() {
const req = await import('./test') // TWO
}
}
export const obj = {
m: async () => {
const req = await import('./test') // THREE
}
}
export class cl2 {
public p = {
m: async () => {
const req = await import('./test') // FOUR
}
}
}
export const l = async () => {
const req = await import('./test') // FIVE
}
@@ -0,0 +1,33 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/dynamicImport/test.ts (0 errors) ====
export async function fn() {
const req = await import('./test') // ONE
}
export class cl1 {
public async m() {
const req = await import('./test') // TWO
}
}
export const obj = {
m: async () => {
const req = await import('./test') // THREE
}
}
export class cl2 {
public p = {
m: async () => {
const req = await import('./test') // FOUR
}
}
}
export const l = async () => {
const req = await import('./test') // FIVE
}
@@ -0,0 +1,33 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/dynamicImport/test.ts (0 errors) ====
export async function fn() {
const req = await import('./test') // ONE
}
export class cl1 {
public async m() {
const req = await import('./test') // TWO
}
}
export const obj = {
m: async () => {
const req = await import('./test') // THREE
}
}
export class cl2 {
public p = {
m: async () => {
const req = await import('./test') // FOUR
}
}
}
export const l = async () => {
const req = await import('./test') // FIVE
}
@@ -0,0 +1,33 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/dynamicImport/test.ts (0 errors) ====
export async function fn() {
const req = await import('./test') // ONE
}
export class cl1 {
public async m() {
const req = await import('./test') // TWO
}
}
export const obj = {
m: async () => {
const req = await import('./test') // THREE
}
}
export class cl2 {
public p = {
m: async () => {
const req = await import('./test') // FOUR
}
}
}
export const l = async () => {
const req = await import('./test') // FIVE
}
@@ -0,0 +1,8 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/incrementalOut.ts (0 errors) ====
const x = 10;
@@ -1,8 +1,10 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/conformance/salsa/a.js(14,13): error TS7008: Member 'inMethodNullable' implicitly has an 'any' type.
tests/cases/conformance/salsa/a.js(20,9): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/salsa/a.js(39,9): error TS2322: Type 'boolean' is not assignable to type 'number'.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/conformance/salsa/a.js (3 errors) ====
class C {
constructor() {
@@ -0,0 +1,7 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/inlineSourceMap.ts (0 errors) ====
var x = 0;
console.log(x);
@@ -1,9 +1,13 @@
error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.
error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.
!!! error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/inlineSourceMap2.ts (0 errors) ====
// configuration errors
@@ -0,0 +1,13 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.ts (0 errors) ====
var a = 0;
console.log(a);
==== tests/cases/compiler/b.ts (0 errors) ====
var b = 0;
console.log(b);
@@ -0,0 +1,13 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.ts (0 errors) ====
var a = 0;
console.log(a);
==== tests/cases/compiler/b.ts (0 errors) ====
var b = 0;
console.log(b);
@@ -0,0 +1,6 @@
error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/isLiteral2.ts (0 errors) ====
var x: number = 02343
@@ -1,9 +1,11 @@
error TS5053: Option 'out' cannot be specified with option 'isolatedModules'.
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/compiler/file1.ts(1,1): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'.
tests/cases/compiler/file2.ts(1,1): error TS1208: 'file2.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module.
!!! error TS5053: Option 'out' cannot be specified with option 'isolatedModules'.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/file1.ts (1 errors) ====
export var x;
~~~~~~~~~~~~~
@@ -0,0 +1,10 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.js (0 errors) ====
class c {
method(a) {
let x = a => this.method(a);
}
}
@@ -1,6 +1,8 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/compiler/a.ts(1,10): error TS2393: Duplicate function implementation.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/b.js (0 errors) ====
function foo() {
return 10;
@@ -1,6 +1,8 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/compiler/a.ts(1,10): error TS2393: Duplicate function implementation.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.ts (1 errors) ====
function foo() {
~~~
@@ -0,0 +1,10 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.ts (0 errors) ====
var x = 10;
==== tests/cases/compiler/b.js (0 errors) ====
var x = "hello"; // Error is recorded here, but suppressed because the js file isn't checked
@@ -15,18 +15,3 @@ var x = "hello"; // Error is recorded here, but suppressed because the js file i
//// [out.d.ts]
declare var x: number;
declare var x: string;
//// [DtsFileErrors]
out.d.ts(2,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'string'.
==== out.d.ts (1 errors) ====
declare var x: number;
declare var x: string;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'string'.
!!! related TS6203 out.d.ts:1:13: 'x' was also declared here.
@@ -1,6 +1,8 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/b.js (0 errors) ====
var x = "hello";
@@ -0,0 +1,12 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}
==== tests/cases/compiler/b.js (0 errors) ====
function foo() {
}
@@ -0,0 +1,17 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}
==== tests/cases/compiler/b.js (0 errors) ====
/// <reference path="c.js"/>
function foo() {
}
==== tests/cases/compiler/c.js (0 errors) ====
function bar() {
}
@@ -0,0 +1,17 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}
==== tests/cases/compiler/b.ts (0 errors) ====
/// <reference path="c.js"/>
function foo() {
}
==== tests/cases/compiler/c.js (0 errors) ====
function bar() {
}
@@ -0,0 +1,10 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.js (0 errors) ====
function foo(a) {
for (let a = 0; a < 10; a++) {
// do something
}
}
@@ -0,0 +1,12 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/b.js (0 errors) ====
let a = 10;
b = 30;
==== tests/cases/compiler/a.ts (0 errors) ====
let b = 30;
a = 10;
@@ -1,6 +1,8 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
tests/cases/compiler/a.ts(2,1): error TS2448: Block-scoped variable 'a' used before its declaration.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.ts (1 errors) ====
let b = 30;
a = 10;
@@ -0,0 +1,17 @@
error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
!!! error TS5101: Flag 'out' is deprecated and will stop functioning in TypeScript 5.5. Specify 'ignoreDeprecations: "5.0"' to silence this error.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}
==== tests/cases/compiler/b.ts (0 errors) ====
/// <reference path="c.js"/>
//no error on above reference since not emitting declarations
function foo() {
}
==== tests/cases/compiler/c.js (0 errors) ====
function bar() {
}
Loaded 100 of 518 files, more files were not shown because too many files have changed in this diff. Show more