0.9.0 • Published 2 years ago
@zanminkian/tsconfig v0.9.0
@zanminkian/tsconfig
Strict shared tsconfig out-of-box
Feature
- Strictest configs with best practices.
 - One-line of tsconfig.
 - Support 
ESMandCommonJSbytypefield inpackage.json. - Support FE (eg: React) & BE (eg: Nest) project.
 
Requirement
- Typescript 5.0+.
 - Node 16+.
 
Usage
Install
npm i @zanminkian/tsconfig -DFor node project, you may need to install @types/node additionally.
npm i @types/node -DFor frontend project (like React), you may need to install @types/web additionally.
npm i @types/web -DConfig tsconfig.json
{
  "extends": "@zanminkian/tsconfig"
}Best Practices
Here are the best practices if you are using this package.
For polyrepo
├── src
│   └── index.ts
├── test
│   └── index.spec.ts
├── package.json
├── tsconfig.build.json
└── tsconfig.jsontsconfig.json
{
  "extends": "@zanminkian/tsconfig"
}tsconfig.build.json
{
  "extends": "./tsconfig",
  "include": ["src"],
  "exclude": ["**/*.spec.ts"],
  "compilerOptions": {
    "outDir": "dist"
  }
}For monorepo
├── apps
│   ├── app1
│   │   ├── src
│   │   │   └── main.ts
│   │   ├── test
│   │   │   └── main.spec.ts
│   │   ├── package.json
│   │   └── tsconfig.build.json
│   └── app2
│       ├── src
│       │   └── main.ts
│       ├── test
│       │   └── main.spec.ts
│       ├── package.json
│       └── tsconfig.build.json
├── package.json
└── tsconfig.jsontsconfig.json in the root of project
{
  "extends": "@zanminkian/tsconfig"
}tsconfig.build.json in each app
{
  "extends": "../../tsconfig",
  "include": ["src"],
  "exclude": ["**/*.spec.ts"],
  "compilerOptions": {
    "outDir": "dist"
  }
}Commands
After installing @zanminkian/tsconfig, you can run npx tsconfig init command to generate a tsconfig.json file. Run npx tsconfig init -h for more detail of the command:
Usage: tsconfig init [options]
init a tsconfig file
Options:
  -t, --to <path>        directory that generating to (default: ".")
  -n, --name <filename>  tsconfig file name (default: "tsconfig.json")
  -h, --help             display help for commandLicense
MIT
0.9.0
2 years ago
0.8.1
2 years ago
0.8.0
2 years ago
0.7.1
2 years ago
0.5.0
2 years ago
0.7.0
2 years ago
0.6.0
2 years ago
0.5.1
2 years ago
0.4.2
3 years ago
0.3.0
3 years ago
0.2.1
3 years ago
0.4.1
3 years ago
0.3.2
3 years ago
0.2.3
3 years ago
0.4.0
3 years ago
0.3.1
3 years ago
0.2.2
3 years ago
0.2.0
3 years ago
0.1.4
3 years ago
0.1.3
3 years ago
0.1.2
3 years ago
0.1.1
3 years ago
0.1.0
3 years ago