Skip to content
StacklysPublic

About

📦 Strict, zero-waste, and modern TypeScript base configurations for typescript projects.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Tsconfig template


divider

  📦 SETUP • ⚙️ CONFIGURATION

divider


               

divider

About

This package provides modular TypeScript configurations for various project runtime requirements:

divider

Table of content


divider

Installation

Bun

bun i -D @stacklys/tsconfig

Npm

npm i -D @stacklys/tsconfig

Pnpm

pnpm i -D @stacklys/tsconfig

Yarn

yarn i -D @stacklys/tsconfig

divider

Usage

For setting up a TypeScript project with the recommended configuration, simply install the package and extend the configuration in your tsconfig.json file.

{
  "extends": "@stacklys/tsconfig/base"
}

You have base, strict and dom configurations available. You can extend any of these configurations in your tsconfig.json file as needed.

For extending all configuration you can do:

{
  "extends": ["@stacklys/tsconfig/strict", "@stacklys/tsconfig/dom"]
}

divider

Configuration

This is the complete base configuration:

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "resolveJsonModule": true,
    "allowImportingTsExtensions": true,
    "allowJs": true,
    "strict": true,
    "strictBindCallApply": true,
    "strictFunctionTypes": true,
    "strictNullChecks": true,
    "strictPropertyInitialization": true,
    "noImplicitAny": true,
    "noImplicitThis": true,
    "noEmit": true,
    "removeComments": true,
    "newLine": "lf",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "isolatedModules": true,
    "verbatimModuleSyntax": true,
    "skipLibCheck": true
  }
}

For strict configuration, extend the @stacklys/tsconfig/strict in your tsconfig.json file.

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "./base.json",
  "compilerOptions": {
    "allowUnreachableCode": false,
    "allowUnusedLabels": false,
    "exactOptionalPropertyTypes": false,
    "noFallthroughCasesInSwitch": true,
    "noImplicitOverride": true,
    "noImplicitReturns": true,
    "noPropertyAccessFromIndexSignature": false,
    "noUncheckedIndexedAccess": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "useUnknownInCatchVariables": true,
    "types": ["node"]
  }
}

For dom configuration, extend the @stacklys/tsconfig/dom in your tsconfig.json file.

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "compilerOptions": {
    "lib": ["ESNext", "DOM", "DOM.Iterable"],
    "jsx": "preserve"
  }
}

divider

  BACK TO TOP

divider

  Copyright © All rights reserved,
  developed by Luis Monsalve and

About

📦 Strict, zero-waste, and modern TypeScript base configurations for typescript projects.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages