Skip to content

Fill the config cycle into the TS18000 circularity message - #65091

Merged
Ryan Cavanaugh (RyanCavanaugh) merged 1 commit into
microsoft:mainfrom
cplieger:fix-circularity-message-path
Nov 2, 2026
Merged

Ryan Cavanaugh (RyanCavanaugh) merged 1 commit into
microsoft:mainfrom
cplieger:fix-circularity-message-path

Conversation

@cplieger

@cplieger Christopher Plieger (cplieger) commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

parseConfig reports TS18000 when a config's extends chain returns to a config already on the resolution stack, but it passes no argument for the message's {0}. The text then reads Circularity detected while resolving configuration: {0} on the CLI and through the API.

Impact: the message names no config, so in a repository with many configs the user has to find the cycle by hand, and a tool on the API shows the raw placeholder.

parseConfig now passes the configs of the cycle, from the first one on the resolution stack to the config that closes it, joined with ->. Strada's parseConfig passes the whole stack. Here an extended config's parse, with its errors, is cached by path and reused by every project that reaches it, so the whole stack would name the project that filled the cache. The cycle alone holds for every project that reaches it, so a reused entry still names the right configs, though it may start the cycle at another of them. The paths are the stack's path keys.

TestParseJsonSourceFileConfigFileContentReportsCircularExtendsChain parses tsconfig.json, which extends a.json, where a.json and b.json extend each other, and expects one TS18000 whose argument is /project/a.json -> /project/b.json -> /project/a.json. On main the diagnostic has no argument.

I met this while building deadset-ts, the TypeScript analyzer of deadset, on the TypeScript 7 API, and noted it in #64755 and #64825 as a separate cause.

An AI coding agent wrote this patch. I have read, built and tested it and will handle the review.

  • There is an associated issue in the Backlog milestone (required)
  • Code is up-to-date with the main branch
  • You've successfully run npx hereby test
  • You've successfully run npx hereby lint
  • You've successfully run npx hereby check:format
  • There are new or updated tests validating the change

Fixes #65094

Copilot AI balanced review requested due to automatic review settings November 1, 2026 16:18
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 1, 2026
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 1, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

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 are reported for the change to include the circular configuration chain in TS18000 diagnostics.

No open issues 🎉

What changed in this PR

Fixes TS18000’s unfilled {0} placeholder by including the circular configuration chain. Reporting only the cycle keeps the message relevant when cached errors are reused by other projects.

Changes:

  • Formats the cycle’s config paths with ->, including the path that closes the cycle.
  • Adds a regression test verifying the diagnostic argument excludes the project leading into the cycle.
File Description
tsc/​internal/​tsoptions/​tsconfigparsing.go Supplies the cycle path chain to TS18000.
tsc/​internal/​tsoptions/​tsconfigparsing_test.go Verifies one circularity diagnostic with the expected cycle argument.

Review effort: Balanced

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Nov 2, 2026
@RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh) added this pull request to the merge queue Nov 2, 2026
Merged via the queue into microsoft:main with commit 4e5836f Nov 2, 2026
34 checks passed
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Nov 2, 2026
@cplieger
Christopher Plieger (cplieger) deleted the fix-circularity-message-path branch November 2, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

TS18000 circularity message prints its {0} placeholder instead of the config chain

3 participants