@stardust-configs/tsconfig

0.4.0 • Public • Published

@stardust-configs/tsconfig

Shareable TypeScript config

Install

$ npm install @stardust-configs/tsconfig --save-dev

Usage

Edit tsconfig.json.

Default
{
  "extends": "@stardust-configs/tsconfig"
}
Recommended
{
  "extends": "@stardust-configs/tsconfig/recommended.json"
}
Node.js v12
{
  "extends": "@stardust-configs/tsconfig/node12.json"
}
Node.js v14
{
  "extends": "@stardust-configs/tsconfig/node14.json"
}
Node.js v16
{
  "extends": "@stardust-configs/tsconfig/node16.json"
}
Node.js v18
{
  "extends": "@stardust-configs/tsconfig/node18.json"
}
Next.js
{
  "extends": "@stardust-configs/tsconfig/next.json",
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules"]
}

Override

Override tsconfig.json.

baseUrl
{
  "extends": "@stardust-configs/tsconfig",
  "compilerOptions": {
    "baseUrl": "./"
  }
}
paths
{
  "extends": "@stardust-configs/tsconfig",
  "compilerOptions": {
    "paths": {
      "@foo/*": ["./src/foo/*"],
      "@bar/*": ["./src/bar/*"],
      "@baz/*": ["./src/baz/*"]
    }
  }
}
typeRoots
{
  "extends": "@stardust-configs/tsconfig",
  "compilerOptions": {
    "typeRoots": ["./node_modules/@types", "./src/@types"]
  }
}
declaration
{
  "extends": "@stardust-configs/tsconfig",
  "compilerOptions": {
    "declaration": true
  }
}
outDir
{
  "extends": "@stardust-configs/tsconfig",
  "compilerOptions": {
    "outDir": "./dist"
  }
}
noEmit
{
  "extends": "@stardust-configs/tsconfig",
  "compilerOptions": {
    "noEmit": true
  }
}
plugins
{
  "extends": "@stardust-configs/tsconfig",
  "compilerOptions": {
    "plugins": [{ "name": "foo" }, { "name": "bar" }, { "name": "baz" }]
  }
}

FAQ

How decided target of nodexx.json?

Reference Node Target Mapping · microsoft/TypeScript Wiki.

Why compilerOptions contains uppercase letters?

I know that developers are generally written in lowercase only. However, JSON Schema contains uppercase letters.

Author

@p-chan

License

MIT


Inspired by sindresorhus/tsconfig

Readme

Keywords

Package Sidebar

Install

npm i @stardust-configs/tsconfig

Weekly Downloads

112

Version

0.4.0

License

MIT

Unpacked Size

5.81 kB

Total Files

10

Last publish

Collaborators

  • p-chan