1.0.0 • Published 9 months ago

@rainstormy/presets-typescript v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Opinionated Presets for TypeScript

This package provides predefined, opinionated TypeScript configurations to be applied to the extends property in tsconfig.json.

Installation

Install the typescript and @rainstormy/presets-typescript packages with the package manager of your choice:

npm install --save-dev typescript @rainstormy/presets-typescript
pnpm add --save-dev typescript @rainstormy/presets-typescript
yarn add --dev typescript @rainstormy/presets-typescript

Usage

Create a tsconfig.json file and extend @rainstormy/presets-typescript/base 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:

ConfigurationDescription
@rainstormy/presets-typescript/es2023Targets browser apps, full-stack apps, and npm libraries.
@rainstormy/presets-typescript/es2023-nodeTargets Node.js apps.
@rainstormy/presets-typescript/dts+jsGenerates js and d.ts files.
@rainstormy/presets-typescript/dtsGenerates d.ts files only.

You can override the predefined settings by specifying the desired options like compilerOptions and include as usual.

For example:

{
  "$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"]
}

Eject from the preset

Copy the relevant parts of the preset source files and insert them directly into the tsconfig.json file. Make adjustments as needed.

1.0.0

9 months ago

1.0.0-alpha.0

11 months ago

1.0.0-rc.0

2 years ago