-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsconfig.json
101 lines (77 loc) · 3.91 KB
/
tsconfig.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{
"compilerOptions": {
// https://www.typescriptlang.org/tsconfig#baseUrl
"baseUrl": ".",
// This tsconfig is for a library, so it's a good idea to generate .d.ts files.
// https://www.typescriptlang.org/tsconfig#declaration
"declaration": true,
// Source maps for .d.ts files are awesome because they allow a "Go to
// Definition" to go the original .ts file, not the .d.ts (which is much
// less useful).
// https://www.typescriptlang.org/tsconfig#declarationMap
"declarationMap": true,
// All new TypeScript projects should use "esModuleInterop": true.
// https://esbuild.github.io/content-types/#es-module-interop
// https://www.typescriptlang.org/tsconfig#esModuleInterop
"esModuleInterop": true,
// https://www.typescriptlang.org/tsconfig#forceConsistentCasingInFileNames
"forceConsistentCasingInFileNames": true,
// Setting "importHelpers" to true would mean that a consumer of a library
// would need to declare tslib as a dependency. Don't do it!
// https://www.typescriptlang.org/tsconfig#importHelpers
"importHelpers": false,
// This is not important for this project, but it speeds up compilation
// times, so I want to remember it for larger projects.
// https://www.typescriptlang.org/tsconfig#incremental
"incremental": true,
// This project uses esbuild to bundle its applications. esbuild compiles
// the files independently, so we must set "isolatedModules": true.
// https://esbuild.github.io/content-types/#isolated-modules
// https://www.typescriptlang.org/tsconfig#isolatedModules
"isolatedModules": true,
// https://www.typescriptlang.org/tsconfig#lib
// Check Node.js support here:
// https://node.green/
"lib": ["ESNext"],
// https://www.typescriptlang.org/tsconfig#module
"module": "NodeNext",
// https://www.typescriptlang.org/docs/handbook/module-resolution.html
"moduleResolution": "NodeNext",
// https://www.typescriptlang.org/tsconfig#noImplicitAny
"noImplicitAny": true,
// https://www.typescriptlang.org/tsconfig#noUnusedLocals
"noUnusedLocals": true,
// https://www.typescriptlang.org/tsconfig#noUnusedParameters
"noUnusedParameters": true,
"outDir": "./lib",
// As far as I understand, preserveConstEnums has no effect for non-const
// enums and should not affect the bundle size, but it must be set to true
// when isolatedModules is set to true.
// https://stackoverflow.com/questions/28818849/how-do-the-different-enum-variants-work-in-typescript
// https://www.typescriptlang.org/tsconfig#preserveConstEnums
// https://ncjamieson.com/dont-export-const-enums/
"preserveConstEnums": true,
// https://www.typescriptlang.org/tsconfig#removeComments
"removeComments": false,
"rootDir": "./src",
// it would be safer to set skipLibCheck to false, but it's kind of slow.
// Maybe enable it from time to time to type check dependencies.
// https://www.typescriptlang.org/tsconfig#skipLibCheck
"skipLibCheck": true,
// In most cases I want to generate source maps.
// https://m.signalvnoise.com/paying-tribute-to-the-web-with-view-source/
"sourceMap": true,
// strict mode sets many strict compiler options to true in one go.
// https://www.typescriptlang.org/tsconfig#strict
"strict": true,
// https://www.typescriptlang.org/tsconfig#strictNullChecks
"strictNullChecks": true,
// https://www.typescriptlang.org/tsconfig#target
// https://node.green/
"target": "ES2020",
// https://www.typescriptlang.org/tsconfig#typeRoots
"typeRoots": ["./node_modules/@types", "./custom-types"]
},
"exclude": [ "./node_modules", ],
"include": ["./src/**/*.ts"]
}