tsconfig
Shared TypeScript config for my projects
Heavily inspired by sindresorhus/tsconfig
Install
$ npm install --save-dev @preco21/tsconfig
Usage
tsconfig.json
:
{
"extends": "@preco21/tsconfig",
"compilerOptions": {
"outDir": "dist"
},
"include": ["src"]
}
Snippets
For library
setup
{
"extends": "@preco21/tsconfig",
"compilerOptions": {
"lib": ["es2019"],
"esModuleInterop": true,
"declaration": true,
"sourceMap": true,
"incremental": true
},
"include": ["src"]
}
For application
setup
{
"extends": "@preco21/tsconfig",
"compilerOptions": {
"outDir": "dist",
"module": "commonjs",
"lib": ["es2019"],
"esModuleInterop": true,
"resolveJsonModule": true,
"sourceMap": true,
"incremental": true
},
"include": ["src"]
}
For web application
setup
{
"extends": "@preco21/tsconfig",
"compilerOptions": {
"lib": ["es2019", "dom"],
"esModuleInterop": true,
"resolveJsonModule": true,
"sourceMap": true,
"incremental": true
},
"include": ["src"]
}