Converted about 25 *.test.ts files to --strictNullChecks (mostly automatically) #65581
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Continues #65233.
I can split this up into smaller PRs if you'd like 😄 figured I'd try to avoid spamming the PR system first...
These diffs were generated with the following strategy:
src/**/*.test.ts
with thefixes.strictNullChecks
option!
assertions everywhere and a small percentage of the| null
/| undefined
typesnpm run strict-null-check-watch
and fixed up errors manually(void 0)!
->undefined!
)I also went manually did a bunch of these changes on a separate branch to confirm they seem reasonable. Most changes are just adding
!
assertions. A few places, such ascomparers.ts
andterminalEnvironment.test.ts
, I manually redid types in step 3 instead.'./vs/base/test/browser/ui/tree/asyncDataTree.test.ts",
'./vs/editor/contrib/linesOperations/test/linesOperations.test.ts",
'./vs/editor/contrib/linesOperations/test/moveLinesCommand.test.ts",
'./vs/editor/contrib/multicursor/test/multicursor.test.ts",
'./vs/editor/contrib/suggest/test/completionModel.test.ts",
'./vs/editor/contrib/wordOperations/test/wordOperations.test.ts",
'./vs/editor/contrib/wordPartOperations/test/wordPartOperations.test.ts",
'./vs/platform/configuration/test/common/configurationModels.test.ts",
'./vs/platform/extensions/test/node/extensionValidator.test.ts",
'./vs/platform/instantiation/test/common/instantiationService.test.ts",
'./vs/platform/keybinding/test/common/keybindingLabels.test.ts",
'./vs/platform/keybinding/test/common/keybindingResolver.test.ts",
'./vs/platform/markers/test/common/markerService.test.ts",
'./vs/platform/telemetry/test/electron-browser/appInsightsAppender.test.ts",
'./vs/platform/telemetry/test/electron-browser/telemetryService.test.ts",
'./vs/workbench/parts/markers/test/electron-browser/markersModel.test.ts",
'./vs/workbench/parts/snippets/test/electron-browser/snippetFile.test.ts",
'./vs/workbench/parts/snippets/test/electron-browser/snippetsService.test.ts",
'./vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts",
'./vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts",
'./vs/workbench/parts/terminal/test/node/terminalEnvironment.test.ts",
'./vs/workbench/services/commands/test/common/commandService.test.ts",
'./vs/workbench/services/configuration/test/common/configurationModels.test.ts",
'./vs/workbench/services/decorations/test/browser/decorationsService.test.ts",
'./vs/workbench/services/extensions/test/node/rpcProtocol.test.ts",
'./vs/workbench/services/keybinding/test/keybindingIO.test.ts",
'./vs/workbench/services/keybinding/test/macLinuxFallbackKeyboardMapper.test.ts",