-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a TypeScript step to
create-astro
(#4179)
* Add a TypeScript step to create-astro * Add changeset * fred pass Co-authored-by: Fred K. Schott <fkschott@gmail.com>
- Loading branch information
1 parent
77cede7
commit d344f9e
Showing
5 changed files
with
125 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'create-astro': minor | ||
--- | ||
|
||
Add a step to configure how strict TypeScript should be |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"compilerOptions": { | ||
// Enable top-level await, and other modern ESM features. | ||
"target": "ESNext", | ||
"module": "ESNext", | ||
// Enable node-style module resolution, for things like npm package imports. | ||
"moduleResolution": "node", | ||
// Enable JSON imports. | ||
"resolveJsonModule": true, | ||
// Enable stricter transpilation for better output. | ||
"isolatedModules": true, | ||
// Astro will directly run your TypeScript code, no transpilation needed. | ||
"noEmit": true, | ||
// Enable strict type checking. | ||
"strict": true, | ||
// Error when a value import is only used as a type. | ||
"importsNotUsedAsValues": "error" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"compilerOptions": { | ||
// Enable top-level await, and other modern ESM features. | ||
"target": "ESNext", | ||
"module": "ESNext", | ||
// Enable node-style module resolution, for things like npm package imports. | ||
"moduleResolution": "node", | ||
// Enable JSON imports. | ||
"resolveJsonModule": true, | ||
// Enable stricter transpilation for better output. | ||
"isolatedModules": true, | ||
// Astro will directly run your TypeScript code, no transpilation needed. | ||
"noEmit": true, | ||
// Enable strict type checking. | ||
"strict": true, | ||
// Error when a value import is only used as a type. | ||
"importsNotUsedAsValues": "error", | ||
// Report errors for fallthrough cases in switch statements | ||
"noFallthroughCasesInSwitch": true, | ||
// Force functions designed to override their parent class to be specified as `override`. | ||
"noImplicitOverride": true, | ||
// Force functions to specify that they can return `undefined` if a possibe code path does not return a value. | ||
"noImplicitReturns": true, | ||
// Report an error when a variable is declared but never used. | ||
"noUnusedLocals": true, | ||
// Report an error when a parameter is declared but never used. | ||
"noUnusedParameters": true, | ||
// Force the usage of the indexed syntax to access fields declared using an index signature. | ||
"noUncheckedIndexedAccess": true, | ||
// Report an error when the value `undefined` is given to an optional property that doesn't specify `undefined` as a valid value. | ||
"exactOptionalPropertyTypes": true | ||
} | ||
} |