-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
🦋 Changeset detectedLatest commit: 2bf8269 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
documentation/docs/15-types.md
Outdated
"compilerOptions": { | ||
// you must use `import type` to | ||
// import types, rather than `import`, | ||
// for svelte-preprocess to work |
There was a problem hiding this comment.
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 } ..
.
There was a problem hiding this comment.
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
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