Skip to content

Commit edfdb43

Browse files
authored
fix: generate tsconfig/jsconfig correctly for library option (#9712)
1 parent fccd659 commit edfdb43

File tree

7 files changed

+10
-5
lines changed

7 files changed

+10
-5
lines changed

Diff for: .changeset/strong-bikes-join.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-svelte': patch
3+
---
4+
5+
fix: generate tsconfig/jsconfig correctly for library option

Diff for: packages/create-svelte/bin.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,14 @@ const options = await p.group(
6363
types: () =>
6464
p.select({
6565
message: 'Add type checking with TypeScript?',
66+
initialValue: /** @type {'checkjs' | 'typescript' | null} */ ('checkjs'),
6667
options: [
6768
{
6869
label: 'Yes, using JavaScript with JSDoc comments',
69-
// @ts-expect-error :shrug:
7070
value: 'checkjs'
7171
},
7272
{
7373
label: 'Yes, using TypeScript syntax',
74-
// @ts-expect-error :shrug:
7574
value: 'typescript'
7675
},
7776
{ label: 'No', value: null }

Diff for: packages/create-svelte/tsconfig.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
"allowJs": true,
44
"checkJs": true,
55
"noEmit": true,
6-
"noImplicitAny": true,
76
"target": "esnext",
87
"module": "esnext",
98
"moduleResolution": "node",
10-
"allowSyntheticDefaultImports": true
9+
"allowSyntheticDefaultImports": true,
10+
"strict": true,
11+
"skipLibCheck": true
1112
},
1213
"include": ["./scripts/**/*", "./index.js", "./bin.js", "./utils.js"]
1314
}

Diff for: packages/create-svelte/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function mkdirp(dir) {
77
try {
88
fs.mkdirSync(dir, { recursive: true });
99
} catch (e) {
10-
if (e.code === 'EEXIST') return;
10+
if (/** @type {any} */ (e).code === 'EEXIST') return;
1111
throw e;
1212
}
1313
}

0 commit comments

Comments
 (0)