Skip to content

feat(create-vite): set types compiler option in tsconfigs #20132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ArnaudBarre
Copy link
Member

It will be the default in the next tsc --init, and I think we should do too. See #20131 for impact once the codebase grows.

The shared config in the vue template already sets it.

I updated the svelte one to include previous changes (isolatedModules is implied by the bundler mode in the shared config)

@ArnaudBarre ArnaudBarre self-assigned this May 29, 2025
@ArnaudBarre ArnaudBarre changed the title fix(create-vite): set types compiler option in tsconfigs feat(create-vite): set types compiler option in tsconfigs May 29, 2025
@sapphi-red sapphi-red added the feat: create-vite create-vite package label May 30, 2025
@sapphi-red
Copy link
Member

This could be confusing for beginners as I guess most articles expect types to be not set, but maybe it's fine as the vue template sets it.

We should remove / replace this part.

**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?**
Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information.

@ArnaudBarre
Copy link
Member Author

Ah yeah if we do that we can have types: ["vite/client"] in app tsconfigs and remove the extra vite-env.d.ts file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: create-vite create-vite package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants