Skip to content

Instantly share code, notes, and snippets.

@feliperdamaceno
Last active January 6, 2025 00:19
Show Gist options
  • Select an option

  • Save feliperdamaceno/04e834eaf3d9c7a183e270a715a345eb to your computer and use it in GitHub Desktop.

Select an option

Save feliperdamaceno/04e834eaf3d9c7a183e270a715a345eb to your computer and use it in GitHub Desktop.
TS Config Starter Kit.
{
"compilerOptions": {
/* Base Options: */
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"target": "ES2022" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
"resolveJsonModule": true /* Enable importing .json files. */,
"moduleDetection": "force" /* Control what method is used to detect module-format JS files. */,
"isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
"verbatimModuleSyntax": true /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */,
/* Strictness */
"strict": true /* Enable all strict type-checking options. */,
"noUncheckedIndexedAccess": true /* Add 'undefined' to a type when accessed using an index. */,
"noImplicitOverride": true /* Ensure overriding members in derived classes are marked with an override modifier. */,
/* If targeting Node: */
"module": "NodeNext" /* Specify what module code is generated. */,
"outDir": "dist" /* Specify an output folder for all emitted files. */,
"sourceMap": true /* Create source map files for emitted JavaScript files. */,
"lib": [
"ES2022"
] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
/* AND if building for a library: */
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
/* AND if building for a library in a monorepo: */
"composite": true /* Enable constraints that allow a TypeScript project to be used with project references. */,
"declarationMap": true /* Create sourcemaps for d.ts files. */,
/* Else targeting the Browser: */
"moduleResolution": "Bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
"module": "ESNext" /* Specify what module code is generated. */,
"noEmit": true /* Disable emitting files from a compilation. */,
"lib": [
"ESNext",
"DOM",
"DOM.Iterable"
] /* Specify a set of bundled library declaration files that describe the target runtime environment. */
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment