chore(null): switch strictNullChecks config from opt-in to opt-out for new files #6284
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.
Details
This PR updates our strictNullChecks config and tooling to include all non-test
.ts
and.tsx
files in the strict null checks set by default, only excluding those files explicitly marked as having known issues intsconfig.strictNullChecks.json
. This:strictNullChecks
config file a lot (it reduces the size by half and is now a flat list of files instead of a mix of files and glob patterns)yarn null:autoadd
for most changes, since new files are now implicitly addedTo implement this, I wrote a script to perform the conversion from an include list to an exclude list. I included it for review in this PR, but I don't expect it to need to be run again in the future. I verified that
yarn null:progress
reports finding the same counts of checked and eligible files before and after the change:I ensured that the assorted helper scripts (
yarn null:find
,yarn null:autoadd
,yarn null:check
) all still work as expected.Motivation
#2869 and see above
Context
I considered renaming
autoadd
to something else now that it's arguably "removing an exclusion" rather than "adding an inclusion", but I decided to leave it as it; it's still "adding new files to the strict null checked set" and it felt like more work/confusion than it was worth to try to update all the issues/team working knowledge/etc about it.Pull request checklist
[x] Ranyarn null:autoadd
yarn fastpass
yarn test
)<rootDir>/test-results/unit/coverage
fix:
,chore:
,feat(feature-name):
,refactor:
). SeeCONTRIBUTING.md
.