feat: also generate a tsconfig.json when using TypeScript#176
Conversation
Skn0tt
left a comment
There was a problem hiding this comment.
Do we need the target/module/moduleResolution fields in the config? When I open it in VS Code, things work just fine without the fields, and only types added.
| @@ -3,6 +3,9 @@ | |||
| "allowSyntheticDefaultImports": true, | |||
| "noEmit": true, | |||
| "jsx": "react-jsx", | |||
There was a problem hiding this comment.
With TypeScript 6, the default for types changed: https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/#types-now-defaults-to-[]
This means we need to add "types": ["node"] here. It's weird that TypeScript docs on this aren't yet updated 🤔 microsoft/TypeScript#63392
| "jsx": "react-jsx", | ||
| "target": "ESNext", | ||
| "module": "ESNext", | ||
| "moduleResolution": "Node", |
There was a problem hiding this comment.
I get this compiler warning:
Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
Visit https://aka.ms/ts6 for migration information.ts
Node is an alias to node10. I think we should go with bundler, since TypeScript doesn't do any compilation in our case and Playwright has it's own loader with lax semantics around module resolution:
| "moduleResolution": "Node", | |
| "moduleResolution": "bundler", |
i was searching around trying to find a minimum viable but if you dont think theyre necessary then i can remove :) |
Skn0tt
left a comment
There was a problem hiding this comment.
The fields weren't necessary in my testing, and we haven't heard about it from Component Testing folks who already use this file. I'd ship without target, but leaving it up to you.
fixes microsoft/playwright#41246