Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4484,7 +4484,7 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
createDeprecatedDiagnostic("charset");
}
if (options.out) {
createDeprecatedDiagnostic("out", /*value*/ undefined, "outFile");
createDeprecatedDiagnostic("out");
}
if (options.importsNotUsedAsValues) {
createDeprecatedDiagnostic("importsNotUsedAsValues", /*value*/ undefined, "verbatimModuleSyntax");
Expand All @@ -4510,6 +4510,9 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
if (options.allowSyntheticDefaultImports === false) {
createDeprecatedDiagnostic("allowSyntheticDefaultImports", "false", /*useInstead*/ undefined, /*related*/ undefined);
}
if (options.outFile) {
createDeprecatedDiagnostic("outFile");
}
if (options.module === ModuleKind.None || options.module === ModuleKind.AMD || options.module === ModuleKind.UMD || options.module === ModuleKind.System) {
createDeprecatedDiagnostic("module", ModuleKind[options.module], /*useInstead*/ undefined, /*related*/ undefined);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/baselines/reference/alwaysStrictModule2.errors.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
a.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode.
b.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== a.ts (1 errors) ====
namespace M {
export function f() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== Class.ts (0 errors) ====
import { Configurable } from "./Configurable"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== file1.ts (0 errors) ====
/// <amd-module name="mynamespace::SomeModuleA" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== c.ts (0 errors) ====
let foo: typeof C;
==== b.ts (0 errors) ====
class C { }

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== test.ts (0 errors) ====
namespace C {
Expand Down
30 changes: 30 additions & 0 deletions tests/baselines/reference/bundledDtsLateExportRenaming.errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== index.ts (0 errors) ====
export * from "./nested";

==== nested/base.ts (0 errors) ====
import { B } from "./shared";

export function f() {
return new B();
}

==== nested/derived.ts (0 errors) ====
import { f } from "./base";

export function g() {
return f();
}

==== nested/index.ts (0 errors) ====
export * from "./base";

export * from "./derived";
export * from "./shared";

==== nested/shared.ts (0 errors) ====
export class B {}

31 changes: 0 additions & 31 deletions tests/baselines/reference/bundledDtsLateExportRenaming.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,3 @@ declare module "nested/index" {
declare module "index" {
export * from "nested/index";
}


//// [DtsFileErrors]


dist/out.d.ts(10,33): error TS2307: Cannot find module 'nested' or its corresponding type declarations.


==== dist/out.d.ts (1 errors) ====
declare module "nested/shared" {
export class B {
}
}
declare module "nested/base" {
import { B } from "nested/shared";
export function f(): B;
}
declare module "nested/derived" {
export function g(): import("nested").B;
~~~~~~~~
!!! error TS2307: Cannot find module 'nested' or its corresponding type declarations.
}
declare module "nested/index" {
export * from "nested/base";
export * from "nested/derived";
export * from "nested/shared";
}
declare module "index" {
export * from "nested/index";
}

Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
weird.js(1,1): error TS2552: Cannot find name 'someFunction'. Did you mean 'Function'?
weird.js(1,23): error TS7006: Parameter 'BaseClass' implicitly has an 'any' type.
weird.js(9,17): error TS7006: Parameter 'error' implicitly has an 'any' type.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== weird.js (3 errors) ====
someFunction(function(BaseClass) {
~~~~~~~~~~~~
Expand Down
2 changes: 2 additions & 0 deletions tests/baselines/reference/checkJsdocOnEndOfFile.errors.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
eof.js(2,20): error TS2304: Cannot find name 'bad'.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== eof.js (1 errors) ====
/**
* @typedef {Array<bad>} Should have error here
Expand Down
2 changes: 2 additions & 0 deletions tests/baselines/reference/checkJsdocReturnTag1.errors.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
returns.js(20,12): error TS2872: This kind of expression is always truthy.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== returns.js (1 errors) ====
// @ts-check
/**
Expand Down
2 changes: 2 additions & 0 deletions tests/baselines/reference/checkJsdocReturnTag2.errors.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
returns.js(6,5): error TS2322: Type 'number' is not assignable to type 'string'.
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'.
returns.js(13,12): error TS2872: This kind of expression is always truthy.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== returns.js (3 errors) ====
// @ts-check
/**
Expand Down
2 changes: 2 additions & 0 deletions tests/baselines/reference/commonSourceDir5.errors.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile.
==== A:/bar.ts (0 errors) ====
import {z} from "./foo";
Expand Down
2 changes: 2 additions & 0 deletions tests/baselines/reference/commonSourceDir6.errors.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== a/bar.ts (0 errors) ====
import {z} from "./foo";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== a.ts (0 errors) ====
class c {
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== a.ts (0 errors) ====
class c {
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== computedPropertyNames52.js (0 errors) ====
const array = [];
for (let i = 0; i < 10; ++i) {
array.push(class C {
[i] = () => C;
static [i] = 100;
})
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== computedPropertyNames52.js (0 errors) ====
const array = [];
for (let i = 0; i < 10; ++i) {
array.push(class C {
[i] = () => C;
static [i] = 100;
})
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
file1.ts(1,1): error TS2448: Block-scoped variable 'c' used before its declaration.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== file1.ts (1 errors) ====
c;
~
Expand Down
109 changes: 109 additions & 0 deletions tests/baselines/reference/controlFlowJavascript.errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== 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
};
}

Loading
Loading