Skip to content

Commit 9144da6

Browse files
Add ignoreDeprecations to test to silence alwaysStrict warning
Co-authored-by: RyanCavanaugh <[email protected]>
1 parent e6282ce commit 9144da6

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/testRunner/unittests/tscWatch/programUpdates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ foo().hello`,
16001600
},
16011601
{
16021602
caption: "Set always strict false",
1603-
edit: sys => sys.writeFile(`/user/username/projects/myproject/tsconfig.json`, jsonToReadableText({ compilerOptions: { strict: true, alwaysStrict: false } })), // Avoid changing 'alwaysStrict' or must re-bind
1603+
edit: sys => sys.writeFile(`/user/username/projects/myproject/tsconfig.json`, jsonToReadableText({ compilerOptions: { strict: true, alwaysStrict: false, ignoreDeprecations: "6.0" } })), // Avoid changing 'alwaysStrict' or must re-bind
16041604
timeouts: sys => sys.runQueuedTimeoutCallbacks(),
16051605
},
16061606
{

tests/baselines/reference/tscWatch/programUpdates/updates-errors-when-strictNullChecks-changes.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ Input::
140140
{
141141
"compilerOptions": {
142142
"strict": true,
143-
"alwaysStrict": false
143+
"alwaysStrict": false,
144+
"ignoreDeprecations": "6.0"
144145
}
145146
}
146147

@@ -157,10 +158,10 @@ Output::
157158
>> Screen clear
158159
[HH:MM:SS AM] File change detected. Starting incremental compilation...
159160

160-
[96mtsconfig.json[0m:[93m4[0m:[93m21[0m - [91merror[0m[90m TS5107: [0mOption 'alwaysStrict=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
161+
[96ma.ts[0m:[93m2[0m:[93m1[0m - [91merror[0m[90m TS2531: [0mObject is possibly 'null'.
161162

162-
[7m4[0m "alwaysStrict": false
163-
[7m [0m [91m ~~~~~[0m
163+
[7m2[0m foo().hello
164+
[7m [0m [91m~~~~~[0m
164165

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

@@ -174,6 +175,7 @@ Program root files: [
174175
Program options: {
175176
"strict": true,
176177
"alwaysStrict": false,
178+
"ignoreDeprecations": "6.0",
177179
"watch": true,
178180
"configFilePath": "/user/username/projects/myproject/tsconfig.json"
179181
}
@@ -182,7 +184,9 @@ Program files::
182184
/home/src/tslibs/TS/Lib/lib.d.ts
183185
/user/username/projects/myproject/a.ts
184186

185-
No cached semantic diagnostics in the builder::
187+
Semantic diagnostics in builder refreshed for::
188+
/home/src/tslibs/TS/Lib/lib.d.ts
189+
/user/username/projects/myproject/a.ts
186190

187191
No shapes updated in the builder::
188192

0 commit comments

Comments
 (0)