Skip to content

detra-lab/tsc

TS Configs

NPM Version NPM Downloads

A collection of TSConfigs to extend in your own apps, tuned to a particular runtime environment.

Available configurations

Node.js - CJS

A version of Node >= 16 is supported by the following configuration.

To install the configuration and its related dev-dependencies, use the following command:

pnpm add -D @detra-lab/tsc typescript @types/node@16

After the installation, add the code snippet below to your tsconfig.json file:

{
  "extends": "@detra-lab/tsc/node/cjs",
  "compilerOptions": {
    "declarationDir": "./types",
    "typeRoots": ["./types", "./node_modules/@types"]
  }
}
Node.js - ESM

A version of Node >= 16 is supported by the following configuration.

To install the configuration and its related dev-dependencies, use the following command:

pnpm add -D @detra-lab/tsc typescript @types/node@16

After the installation, add the code snippet below to your tsconfig.json file:

{
  "extends": "@detra-lab/tsc/node/esm",
  "compilerOptions": {
    "declarationDir": "./types",
    "typeRoots": ["./types", "./node_modules/@types"]
  }
}
Lit

If you're working on projects that use Lit with TypeScript, you can simplify the setup process by installing a configuration and its related dependencies using the following command:

pnpm add -D @detra-lab/tsc typescript

After the installation, add the code snippet below to your tsconfig.json file:

{
  "extends": "@detra-lab/tsc/lit"
}
React.js

When working on projects that involve using React with TypeScript, such as Create React App or Next.js, you can simplify the setup process by installing a configuration and its dependencies with a single command:

pnpm add -D @detra-lab/tsc typescript

After the installation, add the code snippet below to your tsconfig.json file:

{
  "extends": "@detra-lab/tsc/react"
}

Code of Conduct

Help us keep the project open and inclusive. Please read and follow our Code of Conduct.

License

Apache License 2.0

Detra Logo

Human-Made by Detra.
© 2023