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

[feat] use preserveValueImports flag in create-svelte #3064

Merged
merged 2 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/metal-ears-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

use preserveValueImports flag
4 changes: 2 additions & 2 deletions packages/create-svelte/shared/+prettier/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"devDependencies": {
"prettier": "^2.4.1",
"prettier-plugin-svelte": "^2.4.0"
"prettier": "^2.5.1",
"prettier-plugin-svelte": "^2.5.0"
}
}
4 changes: 2 additions & 2 deletions packages/create-svelte/shared/+typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch"
},
"devDependencies": {
"typescript": "^4.4.3",
"typescript": "~4.5.4",
"tslib": "^2.3.1",
"svelte-check": "^2.2.6",
"svelte-preprocess": "^4.9.4"
"svelte-preprocess": "^4.10.1"
}
}
9 changes: 7 additions & 2 deletions packages/create-svelte/shared/+typescript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@
/**
svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript
to enforce using \`import type\` instead of \`import\` for Types.
*/
*/
"importsNotUsedAsValues": "error",
/**
TypeScript doesn't know about import usages in the template because it only sees the
script of a Svelte file. Therefore preserve all value imports. Requires TS 4.5 or higher.
*/
"preserveValueImports": true,
"isolatedModules": true,
"resolveJsonModule": true,
/**
To have warnings/errors of the Svelte compiler at the correct position,
enable source maps by default.
*/
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
Expand Down