Skip to content

fix: make the generated tsconfig.json cover the generated files - #184

Merged
Pavel Feldman (pavelfeldman) merged 2 commits into
mainfrom
fix-tsconfig-include
Oct 5, 2026
Merged

Pavel Feldman (pavelfeldman) merged 2 commits into
mainfrom
fix-tsconfig-include

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

fixes microsoft/playwright#43097

The tsconfig.json added in #176 only included ./src, which a new project does not have (tsc -p . fails with "No inputs were found"). So playwright.config.ts and the tests were not part of any TypeScript project, and since TypeScript 6 defaults types to [], editors report Cannot find name 'process' in the generated config.

  • include the test directory and playwright.config.ts, and use the compiler options suggested in the issue; drop the jsx option left over from component testing
  • only generate tsconfig.json when the project does not have one. Before, an existing one was silently overwritten, and --quiet exited with "These files already exist"
  • add tests that type-check a scaffolded project with tsc (for tests and e2e test dirs) and that keep an existing tsconfig.json

The generated tsconfig.json only included `./src`, which a new project
does not have, so the Playwright config and tests were not part of any
TypeScript project. With TypeScript 6 defaulting `types` to `[]`, editors
then report `Cannot find name 'process'` in playwright.config.ts.

Include the test directory and playwright.config.ts, drop the leftover
component testing `jsx` option, and leave an existing tsconfig.json
untouched instead of overwriting it (or failing in --quiet mode).

Fixes microsoft/playwright#43097
@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 0ee9d71 into main Oct 5, 2026
7 of 16 checks passed
@pavelfeldman
Pavel Feldman (pavelfeldman) deleted the fix-tsconfig-include branch October 5, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: generate a tsconfig.json when scaffolding a TypeScript project

2 participants