Skip to content

agilgur5/tsconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tsconfig

package-json releases commits

My tsconfig base files, extending @tsconfig/strictest.

Installation

npm i -D @agilgur5/tsconfig

Usage

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:

  • base adds to @tsconfig/strictest config around resolution (moduleResolution, resolveJsonFile) and emit (sourceMap, jsx, and noEmit)
  • library adds to base config for libraries (declaration, declarationMap)
  • library-build adds to library config used if you compile to JS with a separate tool (e.g. Rollup, Babel), but use tsc to output declarations (emitDeclarationOnly)