forked from opral/monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsconfig.base.json
49 lines (49 loc) · 2.09 KB
/
tsconfig.base.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* Default TypeScript config for the inlang project.
*
* The goal of this config is strict ESM compilation across the inlang project.
* See https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-make-my-typescript-project-output-esm
*/
{
"compilerOptions": {
// Set the compiler to ESM (node16)
"module": "Node16",
// Resolve modules with ESM (node16)
"moduleResolution": "Node16",
// Compile to ... syntax (makes importing easier, if the importing environment does not support new syntax features)
"target": "ES2020", // ES2020 = Node.js 14
// To provide backwards compatibility, Node.js allows you to import most CommonJS packages with a default import. This flag tells TypeScript that it's okay to use import on CommonJS modules.
"allowSyntheticDefaultImports": true,
// ESM doesn't support JSON modules yet.
"resolveJsonModule": false,
// Create type declaration files (otherwise no typesafety for the importing module)
"declaration": true,
// For debugging
"sourceMap": true,
// Strict type checking
"strict": true,
// forcing consistens casing in files is a life saver (different environments deal with file casing differently)
"forceConsistentCasingInFileNames": true,
// only include certain types in node modules, see https://stackoverflow.com/a/69649992
// commonjs types of imported dependencies error out otherwise
"types": ["node"],
// Don't check imported libraries for type errors.
// The imported libraries might have different settings/whatever.
"skipLibCheck": true,
"skipDefaultLibCheck": true,
// Lint JS files
"checkJs": true,
// Distingish between type imports and code imports.
"importsNotUsedAsValues": "error",
// tremendous helper to avoid hard to debug bugs.
// see https://github.com/inlang/inlang/issues/157
"noUncheckedIndexedAccess": true,
// enables better DX https://twitter.com/kuizinas/status/1636641120477384705?s=20
"declarationMap": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"allowUnreachableCode": false
}
}