0.1.0 • Published 2 years ago
@agilgur5/tsconfig v0.1.0
tsconfig
My tsconfig base files, extending @tsconfig/strictest.
Installation
npm i -D @agilgur5/tsconfigUsage
tsconfig.json:
{
  // https://github.com/agilgur5/tsconfig
  "extends": "@agilgur5/tsconfig/library",
  // exclude node_modules (the default), dist dir, coverage dir
  "exclude": ["node_modules/", "dist/", "coverage/"],
  // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
  "compilerOptions": {
    // output to dist/ dir
    "outDir": "dist/",
  },
}NOTE: Due to microsoft/TypeScript#48665, TypeScript versions older than v5 must import from @agilgur5/tsconfig/src instead of the shortened package.json#exports.
NOTE: Due to microsoft/TypeScript#29172, we repeat some configurations (files, include, exclude, outDir) from the base config as relative paths are currently resolved within node_modules.
Directory
The configs here do not change any of the type-checking from the @tsconfig/strictest base. They only add a handful more simple, common configurations:
- baseadds to- @tsconfig/strictestconfig around resolution (- moduleResolution,- resolveJsonFile) and emit (- sourceMap,- jsx, and- noEmit)
- libraryadds to- baseconfig for libraries (- declaration,- declarationMap)
- library-buildadds to- libraryconfig used if you compile to JS with a separate tool (e.g. Rollup, Babel), but use- tscto output declarations (- emitDeclarationOnly)