Skip to content

Commit

Permalink
fix: generate tsconfig/jsconfig correctly for library option (#9712)
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Apr 19, 2023
1 parent fccd659 commit edfdb43
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-bikes-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

fix: generate tsconfig/jsconfig correctly for library option
3 changes: 1 addition & 2 deletions packages/create-svelte/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,14 @@ const options = await p.group(
types: () =>
p.select({
message: 'Add type checking with TypeScript?',
initialValue: /** @type {'checkjs' | 'typescript' | null} */ ('checkjs'),
options: [
{
label: 'Yes, using JavaScript with JSDoc comments',
// @ts-expect-error :shrug:
value: 'checkjs'
},
{
label: 'Yes, using TypeScript syntax',
// @ts-expect-error :shrug:
value: 'typescript'
},
{ label: 'No', value: null }
Expand Down
5 changes: 3 additions & 2 deletions packages/create-svelte/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"allowJs": true,
"checkJs": true,
"noEmit": true,
"noImplicitAny": true,
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true
"allowSyntheticDefaultImports": true,
"strict": true,
"skipLibCheck": true
},
"include": ["./scripts/**/*", "./index.js", "./bin.js", "./utils.js"]
}
2 changes: 1 addition & 1 deletion packages/create-svelte/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function mkdirp(dir) {
try {
fs.mkdirSync(dir, { recursive: true });
} catch (e) {
if (e.code === 'EEXIST') return;
if (/** @type {any} */ (e).code === 'EEXIST') return;
throw e;
}
}
Expand Down

0 comments on commit edfdb43

Please sign in to comment.