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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4526,6 +4526,9 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
});

checkDeprecations("6.0", "7.0", createDiagnostic, createDeprecatedDiagnostic => {
if (options.alwaysStrict === false) {
createDeprecatedDiagnostic("alwaysStrict", "false", /*useInstead*/ undefined, /*related*/ undefined);
}
if (options.moduleResolution === ModuleResolutionKind.Node10) {
createDeprecatedDiagnostic("moduleResolution", "node10", /*useInstead*/ undefined, Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information);
}
Expand Down
15 changes: 15 additions & 0 deletions tests/baselines/reference/alwaysStrictDeprecation.errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/foo/tsconfig.json(3,25): error TS5107: Option 'alwaysStrict=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


==== /foo/tsconfig.json (1 errors) ====
{
"compilerOptions": {
"alwaysStrict": false
~~~~~
!!! error TS5107: Option 'alwaysStrict=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
}
}

==== /foo/a.ts (0 errors) ====
const a = 1;

8 changes: 8 additions & 0 deletions tests/baselines/reference/alwaysStrictDeprecation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//// [tests/cases/compiler/alwaysStrictDeprecation.ts] ////

//// [a.ts]
const a = 1;


//// [a.js]
var a = 1;
6 changes: 6 additions & 0 deletions tests/baselines/reference/alwaysStrictDeprecation.symbols
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//// [tests/cases/compiler/alwaysStrictDeprecation.ts] ////

=== /foo/a.ts ===
const a = 1;
>a : Symbol(a, Decl(a.ts, 0, 5))

9 changes: 9 additions & 0 deletions tests/baselines/reference/alwaysStrictDeprecation.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//// [tests/cases/compiler/alwaysStrictDeprecation.ts] ////

=== /foo/a.ts ===
const a = 1;
>a : 1
> : ^
>1 : 1
> : ^

8 changes: 8 additions & 0 deletions tests/baselines/reference/alwaysStrictDeprecationSilenced.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//// [tests/cases/compiler/alwaysStrictDeprecationSilenced.ts] ////

//// [a.ts]
const a = 1;


//// [a.js]
var a = 1;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//// [tests/cases/compiler/alwaysStrictDeprecationSilenced.ts] ////

=== /foo/a.ts ===
const a = 1;
>a : Symbol(a, Decl(a.ts, 0, 5))

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//// [tests/cases/compiler/alwaysStrictDeprecationSilenced.ts] ////

=== /foo/a.ts ===
const a = 1;
>a : 1
> : ^
>1 : 1
> : ^

Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ Output::
>> Screen clear
[HH:MM:SS AM] File change detected. Starting incremental compilation...

a.ts:2:1 - error TS2531: Object is possibly 'null'.
tsconfig.json:4:21 - error TS5107: Option 'alwaysStrict=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

2 foo().hello
  ~~~~~
4 "alwaysStrict": false
   ~~~~~

[HH:MM:SS AM] Found 1 error. Watching for file changes.

Expand All @@ -182,9 +182,7 @@ Program files::
/home/src/tslibs/TS/Lib/lib.d.ts
/user/username/projects/myproject/a.ts

Semantic diagnostics in builder refreshed for::
/home/src/tslibs/TS/Lib/lib.d.ts
/user/username/projects/myproject/a.ts
No cached semantic diagnostics in the builder::

No shapes updated in the builder::

Expand Down
10 changes: 10 additions & 0 deletions tests/cases/compiler/alwaysStrictDeprecation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// @typeScriptVersion: 6.0
// @filename: /foo/tsconfig.json
{
"compilerOptions": {
"alwaysStrict": false
}
}

// @filename: /foo/a.ts
const a = 1;
11 changes: 11 additions & 0 deletions tests/cases/compiler/alwaysStrictDeprecationSilenced.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// @typeScriptVersion: 6.0
// @filename: /foo/tsconfig.json
{
"compilerOptions": {
"alwaysStrict": false,
"ignoreDeprecations": "6.0"
}
}

// @filename: /foo/a.ts
const a = 1;
Loading