Repository navigation
Fix numeric falsiness and circular config parsing - #65474
Open
Jake Bailey (jakebailey) wants to merge 1 commit into
Open
Jake Bailey (jakebailey) wants to merge 1 commit into
Jake Bailey (jakebailey) wants to merge 1 commit into
Conversation
JSON numbers are decoded as float64 values, so comparing boxed values with integer zero leaves numeric zero truthy and in filtered lists. Compare against float64 zero while preserving opt-in falsy lists. Validate each extends array entry rather than the containing array. Use nil-safe string detection so null entries produce diagnostics. Detect supplied raw configs by presence, not size, when stopping a circular extends chain. Preserve empty objects and convert source configs only when no raw object exists, avoiding nil source access. Add behavioral regressions for signed zero, numeric list filtering, invalid extends entries, and circular raw preservation.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the numeric falsiness and configuration parsing fixes.
No open issues 🎉
What changed in this PR
This PR fixes numeric falsiness and configuration parsing edge cases in the native TypeScript compiler, with regression tests for the affected behavior.
Changes:
- Corrects zero-value checks to match JSON numbers stored as
float64. - Preserves raw configuration data during circularity detection and safely validates invalid
extendsarray elements. - Adds coverage for numeric falsiness, circular configurations, and invalid array entries.
| File | Description |
|---|---|
tsc/internal/tsoptions/tsconfigparsing.go |
Fixes numeric filtering, extends validation, and circular config handling. |
tsc/internal/tsoptions/tsconfigparsing_test.go |
Tests null and invalid extends entries across both parsing APIs. |
tsc/internal/tsoptions/parsinghelpers_test.go |
Tests numeric list filtering and raw config preservation during circularity detection. |
tsc/internal/packagejson/jsonvalue.go |
Corrects numeric zero detection in IsFalsy. |
tsc/internal/packagejson/jsonvalue_test.go |
Adds falsiness tests for numbers and other JSON values. |
Review effort: Balanced
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.
Two bugs caught in an audit.