Skip to content

Fix numeric falsiness and circular config parsing - #65474

Open
Jake Bailey (jakebailey) wants to merge 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/config-parsing
Open

Jake Bailey (jakebailey) wants to merge 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/config-parsing

Conversation

@jakebailey

Copy link
Copy Markdown
Member

Two bugs caught in an audit.

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.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 04:50
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 13, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 extends array 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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

2 participants