You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TS18000 circularity message prints its {0} placeholder instead of the config chain #65094
I tried typescript@7.0.2 and typescript@7.1.0-dev.20261101.1 (tsc -p, and the synchronous API, typescript/sync, on the nightly) and typescript@5.9.3 (tsc -p) on linux-x64.
⏯ Playground Link
The playground does not read tsconfig.json files. The reproduction is three config files and one source file in /tmp/proj.
💻 Code
tsconfig.json:
{ "extends": "./a.json" }
a.json:
{ "extends": "./b.json" }
b.json:
{ "extends": "./a.json" }
main.ts:
export const one = 1;
🙁 Actual behavior
The message keeps its {0} placeholder and names no config:
The diagnostic parseConfigFile returns has the same text, Circularity detected while resolving configuration: {0}.
🙂 Expected behavior
The message names the configs in the cycle, for example /tmp/proj/a.json -> /tmp/proj/b.json -> /tmp/proj/a.json. tsc 5.9.3 names them after the whole resolution stack:
parseConfig creates the TS18000 diagnostic with no argument, where Strada's parseConfig passes the resolution stack plus the config that closes it.
#65091 fixes this. It passes only the configs of the cycle, not the whole stack, because an extended config's parse and its errors are cached by path and reused by other projects. It was noted in #64754 and #64824 as a separate cause.
I met this while building deadset-ts, the TypeScript analyzer of deadset, on the TypeScript 7 API.
Activity