Skip to content

Repository files navigation

@tenedev/tsconfig

Shared TypeScript configuration

Publishnpm versionDownloads

Install

npm i -D @tenedev/tsconfig

Requires TypeScript ^7

Usage

Extend it in your tsconfig.json:

{
"extends": "@tenedev/tsconfig",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
},
"include": ["src"],
}

What's included

Environment

OptionValueDescription
targetesnextCompile to latest JS syntax
moduleesnextEmits native ES module syntax without transforming imports/exports
moduleResolutionbundlerUses bundler-style resolution, bypassing Node ESM extension requirements and supporting flexible import paths
libESNext, DOM, DOM.Iterable, DOM.AsyncIterableFull browser + modern JS type definitions

Strict & Safety

OptionDescription
strictEnables all strict checks
alwaysStrictEmits "use strict" in every file
noImplicitAnyError when TS infers any
noImplicitOverrideMust use override keyword in class methods
noImplicitReturnsAll code paths must return
noFallthroughCasesInSwitchNo accidental switch fallthrough
noUnusedLocalsError on unused variables
noUnusedParametersError on unused function params
noUncheckedIndexedAccessIndex access returns T | undefined
noPropertyAccessFromIndexSignatureMust use bracket notation for index types
exactOptionalPropertyTypesOptional props can't be explicitly undefined
useUnknownInCatchVariablesCatch variables are unknown not any
allowUnreachableCodeError on unreachable code
allowUnusedLabelsError on unused labels
noErrorTruncationFull type printed in error messages

Interop

OptionDescription
verbatimModuleSyntaxEnforces import type at syntax level
esModuleInteropDefault imports from CJS modules
allowSyntheticDefaultImportsimport x from 'y' without default export
allowJsAllows .js files in project
allowImportingTsExtensionsImport .ts files with extension
importHelpersUses tslib instead of inlining helpers
resolveJsonModuleImport .json files
isolatedModulesEach file transpilable independently
forceConsistentCasingInFileNamesError on casing mismatches in imports
skipLibCheckSkip type checking of node_modules.d.ts files

Output

OptionDescription
declarationGenerates .d.ts files
declarationMapGenerates .d.ts.map source maps
sourceMapGenerates .js.map source maps
noEmitNo file output - use your bundler

About

πŸͺ„ Shared TypeScript configuration

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors