Predefined, opinionated TypeScript configurations suitable for any TypeScript project.
npm install @rainstormy/presets-typescriptThis package provides predefined,
opinionated TypeScript configurations to be
applied to the extends
property in tsconfig.json.
typescript@rainstormy/presets-typescript``shell`
npm install --save-dev typescript @rainstormy/presets-typescript`shell`
pnpm add --save-dev typescript @rainstormy/presets-typescript`shell`
yarn add --dev typescript @rainstormy/presets-typescript
file and to enable type-checking in general.In addition to this, you can extend some of the following configurations to
refine the TypeScript settings for your project:
| Configuration | Description |
|----------------------------------------------|-----------------------------------------------------------|
|
@rainstormy/presets-typescript/es2023 | Targets browser apps, full-stack apps, and npm libraries. |
| @rainstormy/presets-typescript/es2023-node | Targets Node.js apps. |
| @rainstormy/presets-typescript/dts+js | Generates js and d.ts files. |
| @rainstormy/presets-typescript/dts | Generates d.ts files only. |You can override the predefined settings by specifying the desired options like
compilerOptions and include as usual.For example:
`json
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": [
"@rainstormy/presets-typescript/base",
"@rainstormy/presets-typescript/es2023",
"@rainstormy/presets-typescript/dts+js"
],
"compilerOptions": {
"baseUrl": "./",
"incremental": true,
"noEmitOnError": false,
"outDir": "dist",
"sourceMap": true
},
"include": ["./src/*/.ts", "./.config.js", "./.config.ts"]
}
`$3
Copy the relevant parts of
the preset source files
and insert them directly into the tsconfig.json` file. Make adjustments as