Skip to content

Instantly share code, notes, and snippets.

@wmakeev
Last active August 3, 2023 14:44
Show Gist options
  • Select an option

  • Save wmakeev/a9d2db02501d866543b58e813cfc2aec to your computer and use it in GitHub Desktop.

Select an option

Save wmakeev/a9d2db02501d866543b58e813cfc2aec to your computer and use it in GitHub Desktop.
[02.1.1 tsconfig.json template] #template #tsconfig #typescript #mixin
// https://www.typescriptlang.org/tsconfig
{
"compilerOptions": {
// -- Type Checking
"strict": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"exactOptionalPropertyTypes": false, // depends on project
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": false,
"noUnusedParameters": true,
// -- Modules
"module": "ES2020", // #IF params.ENV = 'GAS'
"module": "CommonJS", // #IF params.ENV != 'GAS'
"moduleResolution": "Node",
"resolveJsonModule": true,
"rootDir": ".",
// -- Emit
"declaration": true,
"declarationMap": true,
"stripInternal": true,
"importsNotUsedAsValues": "error",
"newLine": "lf",
"outDir": "build",
"sourceMap": true,
// -- Editor Support
"plugins": [
{
"name": "typescript-eslint-language-service"
}
],
// -- Interop Constraints
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
// -- Language and Environment
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"lib": [
"ES2020" // Node 14
],
// https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping
"target": "ES2019", // Node 12 // #IF GAS
"target": "ES2020", // Node 14 // #IF !GAS
// -- Projects
"composite": true,
"incremental": true,
// -- Completeness
"skipLibCheck": true
},
"include": ["src/**/*", "test/**/*"]
}
{
"extends": "./tsconfig.json",
"compilerOptions": {
"incremental": false,
"composite": false,
"noUnusedLocals": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment