Skip to content

chore: set explicit rootDir in tsconfigs#539

Merged
willeastcott merged 1 commit into
mainfrom
chore/explicit-rootdir
May 27, 2026
Merged

chore: set explicit rootDir in tsconfigs#539
willeastcott merged 1 commit into
mainfrom
chore/explicit-rootdir

Conversation

@willeastcott
Copy link
Copy Markdown
Contributor

Summary

TypeScript 6 reports TS5011 when @rollup/plugin-typescript invokes the compiler with an inferred rootDir:

The common source directory of 'tsconfig.json' is './src'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout.

Set rootDir to the value TS was already inferring — "./src" for the main project, "../src" for the React project (relative to react/tsconfig.json). On TS 5.9 this is a no-op. On TS 6 it silences the new TS5011 check so #538 can ship.

Test plan

  • npm run build:types clean.
  • npm run build:es6 clean.
  • Verified emitted types/ and react/types/ file listings are byte-identical before vs after (114 files, identical paths).

After merge: Renovate's #538 will rebase and its CI should go green.

🤖 Generated with Claude Code

TypeScript 6 reports TS5011 ("The common source directory of
'tsconfig.json' is './src'. The 'rootDir' setting must be explicitly
set...") when @rollup/plugin-typescript invokes the compiler with an
inferred rootDir. Set rootDir explicitly to the value TS was already
inferring ("./src" for the main project, "../src" for the React
project) so the message goes away.

Verified on TS 5.9.3 that the emitted `types/` and `react/types/`
file listings are byte-identical before and after, so no
consumer-visible declaration shape changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@willeastcott willeastcott self-assigned this May 27, 2026
@willeastcott willeastcott added the enhancement New feature or request label May 27, 2026
@willeastcott willeastcott merged commit 828e998 into main May 27, 2026
5 checks passed
@willeastcott willeastcott deleted the chore/explicit-rootdir branch May 27, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant