This is my personal tsconfig that I aim to use for all my projects in the future. Since the config depends on TypeScript, you only need to install the config, not tsc itself. This has the advantage that the config will always use a compatible tsc version. The main focus is typed JavaScript projects made using NodeJS or otherwise, see below.
npm i -D jelmerro/type-config- Add the following to
tsconfig.json:
{
"extends": "type-config"
}With this config you are able to get the advantages of TypeScript within JavaScript, without the need to compile, build or bundle the code before running it. By using existing types from other packages and defining your own via JSDoc, there is no inline TypeScript code to be removed, yet all types are there to use. This means the JavaScript you write can run directly without any changes if desired, and even if minifying is wanted, stripping comments is much safer/faster than removing types. Since no TypeScript step is involved, tooling like Eslint and such are also faster. Another advantage is that documentation and types are now in the same place.