Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Last active September 1, 2025 08:38
Show Gist options
  • Save cecilemuller/80fed1b963171ca4e117f6d1e2a4a5a7 to your computer and use it in GitHub Desktop.
Save cecilemuller/80fed1b963171ca4e117f6d1e2a4a5a7 to your computer and use it in GitHub Desktop.
Typescript 5.9+ Config
{
// Config for emitting .d.ts files
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "esnext",
"module": "nodenext",
"moduleDetection": "force",
"newLine": "LF",
"strict": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noEmitOnError": true,
"isolatedModules": true,
"allowImportingTsExtensions": true,
"rewriteRelativeImportExtensions": true,
"verbatimModuleSyntax": true,
"erasableSyntaxOnly": true,
"allowArbitraryExtensions": true,
"resolveJsonModule": true,
"outDir": "dist",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true,
"listEmittedFiles": true,
},
"include": [
"src/**/*.ts",
],
}
{
// Config for linting
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "esnext",
"module": "nodenext",
"moduleDetection": "force",
"newLine": "LF",
"strict": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noEmitOnError": true,
"isolatedModules": true,
"allowImportingTsExtensions": true,
"rewriteRelativeImportExtensions": true,
"verbatimModuleSyntax": true,
"erasableSyntaxOnly": true,
"allowArbitraryExtensions": true,
"resolveJsonModule": true,
"outDir": "dist",
"noEmit": true,
},
"include": [
"src/**/*.ts",
"test/**/*.ts",
],
}
@cecilemuller
Copy link
Author

cecilemuller commented Aug 27, 2025

Lint using tsc --project tsconfig.json

Emit .d.ts files using tsc --project tsconfig.dts.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment