Repository navigation
chore(core): ratchet strictNullChecks errors against a per-file baseline - #11511
Open
NathanWalker wants to merge 1 commit into
Open
NathanWalker wants to merge 1 commit into
NathanWalker wants to merge 1 commit into
Conversation
Adds packages/core/tsconfig.strict.json (tsconfig.lib.json with strictNullChecks) and a core:typecheck-strict target that compares the error count of each file with packages/core/strict-baseline.json. A file may not gain errors or newly appear; a file whose count drops must lower the baseline in the same change (--update, which refuses increases). Baseline on main: 1797 errors in 176 files. CI runs the check on pull requests and pushes to main.
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx test apps-automated -c=android |
❌ Failed | 3m 29s | View ↗ |
nx run-many --target=test --configuration=ci --... |
✅ Succeeded | <1s | View ↗ |
💡 Dealing with memory or CPU issues? See memory and CPU details with the resource usage add-on ↗.
☁️ Nx Cloud last updated this comment at 2026-10-07 16:40:46 UTC
commit: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

PR Checklist
What is the current behavior?
@nativescript/coreis type-checked withoutstrictNullChecks, so many of its types state less than its code does (anumberthat is sometimesundefined, an optional parameter narrowed to required in an override). UnderstrictNullCheckscore has 1797 errors in 176 files on main, and nothing type-checks core on pull requests.What is the new behavior?
A ratchet so the strict error count can only go down, ahead of area-by-area, types-only fix PRs. No source changes.
packages/core/tsconfig.strict.json—tsconfig.lib.jsonwithstrictNullChecks,noEmit.tools/scripts/strict-baseline.mjs— runstscon it and compares the error count per file withpackages/core/strict-baseline.json(per file, so an error fixed in one file cannot hide one added in another):--updaterewrites the baseline and refuses increases.core:typecheck-strictNx target (npx nx run core:typecheck-strict [--update]). Not cached: a replayed--updatewould skip writing the baseline, and the check takes ~4s..github/workflows/core_typecheck.yml— runs the target on pull requests and pushes to main (Node +npm cionly, no simulators).tools/notes/DevelopmentWorkflow.mdandAGENTS.md.Verified locally: clean tree passes; an added error in a clean file and in a baselined file both fail with the offending errors listed;
--updaterefuses to record the increase; a lowered count fails until--update, which records it.