Skip to content
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

document generated tsconfig.json, move compilerOptions into user config #4633

Merged
merged 7 commits into from
Apr 18, 2022

Conversation

Rich-Harris
Copy link
Member

@Rich-Harris Rich-Harris commented Apr 15, 2022

https://kit-svelte-dev-git-document-tsconfig-svelte.vercel.app/docs/types#generated-types-default-tsconfig-json

We generate a bunch of config options, but don't explain what they are and which ones can be overridden. This fixes that

@changeset-bot
Copy link

changeset-bot bot commented Apr 15, 2022

🦋 Changeset detected

Latest commit: 2bf8269

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

"compilerOptions": {
// you must use `import type` to
// import types, rather than `import`,
// for svelte-preprocess to work
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last line isn't 100% correct, it's more a hint like "if all of the imports are used as types, throw an error". Writing this, I'm wondering how this plays out in conjunction with "preserveValueImports".. maybe we can remove this option. Need to test this out, don't know when I will get to that.

Btw since TS 4.5 you can mix value and type imports by doing import { type Foo, bar } ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated it — it's slightly tricky because we need to communicate how it affects how people should write code, more than what the option actually does, but it also needs to make sense in context

@Rich-Harris Rich-Harris changed the title document generated tsconfig.json document generated tsconfig.json, move compilerOptions into user config Apr 15, 2022
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.

2 participants