|
| 1 | +{ |
| 2 | + // This tsconfig file contains the shared config for the build (tsconfig.build.json) and type checking (tsconfig.json) config. |
| 3 | + "include": [], |
| 4 | + "compilerOptions": { |
| 5 | + // Incremental builds |
| 6 | + // NOTE: Enabling incremental builds speeds up `tsc`. Keep in mind though that it does not reliably bust the cache when the `tsconfig.json` file changes. |
| 7 | + "incremental": false, |
| 8 | + |
| 9 | + // Type checking |
| 10 | + "strict": true, |
| 11 | + "useDefineForClassFields": true, // Not enabled by default in `strict` mode unless we bump `target` to ES2022. |
| 12 | + "noFallthroughCasesInSwitch": true, // Not enabled by default in `strict` mode. |
| 13 | + "noImplicitReturns": true, // Not enabled by default in `strict` mode. |
| 14 | + "useUnknownInCatchVariables": true, // TODO: This would normally be enabled in `strict` mode but would require some adjustments to the codebase. |
| 15 | + "noImplicitOverride": true, // Not enabled by default in `strict` mode. |
| 16 | + "noUnusedLocals": true, // Not enabled by default in `strict` mode. |
| 17 | + "noUnusedParameters": true, // Not enabled by default in `strict` mode. |
| 18 | + // "exactOptionalPropertyTypes": true, |
| 19 | + // TODO: Uncomment and fix types. |
| 20 | + "declaration": true, |
| 21 | + // "noUncheckedIndexedAccess": true, |
| 22 | + |
| 23 | + // JavaScript support |
| 24 | + "allowJs": false, |
| 25 | + "checkJs": false, |
| 26 | + |
| 27 | + // Interop constraints |
| 28 | + "esModuleInterop": false, |
| 29 | + "allowSyntheticDefaultImports": false, |
| 30 | + "forceConsistentCasingInFileNames": true, |
| 31 | + "verbatimModuleSyntax": false, |
| 32 | + "importHelpers": true, // This is only used for build validation. Since we do not have `tslib` installed, this will fail if we accidentally make use of anything that'd require injection of helpers. |
| 33 | + |
| 34 | + // Language and environment |
| 35 | + "moduleResolution": "Node", |
| 36 | + "module": "commonjs", |
| 37 | + "target": "ES2021", // Setting this to `ES2021` enables native support for `Node v16+`: https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping. |
| 38 | + "lib": [ |
| 39 | + "ES2022", // By using ES2022 we get access to the `.cause` property on `Error` instances. |
| 40 | + "DOM" // We are adding `DOM` here to get the `fetch`, etc. types. This should be removed once these types are available via DefinitelyTyped. |
| 41 | + ], |
| 42 | + |
| 43 | + // Skip type checking for node modules |
| 44 | + "skipLibCheck": true |
| 45 | + } |
| 46 | +} |
0 commit comments