@dareharu/ts-config v1.1.0
@dareharu/ts-config
Shareable TypeScript configuration for Dareharu projects.
Strongly inspired by @sapphiredev/ts-config.
🚀 Installation
Note In the following example commands we use
npm installto fit best suited to the basic environment, feel free to replacenpm installwith your package manager of choice (yarn, pnpm or whatever).
npm install --save-dev @dareharu/ts-config🌟 Usage
You can use @dareharu/ts-config base tsconfig.json by extending it in yours:
{
"extends": "@dareharu/ts-config"
}This TypeScript config is set up in such a way that it will suite nearly all projects, you may extend this to include your own configuration options as well.
Following is a copy of this config file for easy viewing:
{
"compileOnSave": true,
"compilerOptions": {
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"alwaysStrict": true,
"declaration": true,
"declarationMap": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"incremental": true,
"isolatedModules": true,
"lib": ["ESNext"],
"module": "NodeNext",
"moduleResolution": "Node",
"newLine": "lf",
"noEmitHelpers": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"preserveConstEnums": true,
"pretty": true,
"removeComments": false,
"resolveJsonModule": true,
"sourceMap": true,
"strict": true,
"target": "ES2020",
"useDefineForClassFields": true
}
}Config without decorators
You can use @dareharu/ts-config's without-decorators.json by extending it in yours:
{
"extends": "@dareharu/ts-config/without-decorators"
}This TypeScript extends everything from the base config, but disables decorator support.
Following is a copy of this config file for easy viewing:
{
"extends": "./tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": false,
"experimentalDecorators": false
}
}🔗 Meta
Contributing
- Fork it!
- Create your feature branch:
git switch -c my-new-feature - Commit your changes:
git commit -am 'Add awesome feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request!
License
Released under the MIT License.