1.1.0 • Published 2 years ago

@dareharu/ts-config v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@dareharu/ts-config

Shareable TypeScript configuration for Dareharu projects.

License: MIT npm bundle size npm

Strongly inspired by @sapphiredev/ts-config.


🚀 Installation

Note In the following example commands we use npm install to fit best suited to the basic environment, feel free to replace npm install with 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

  1. Fork it!
  2. Create your feature branch: git switch -c my-new-feature
  3. Commit your changes: git commit -am 'Add awesome feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request!

License

Released under the MIT License.