-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathtsconfig_base.jsonc
More file actions
38 lines (33 loc) · 2.06 KB
/
tsconfig_base.jsonc
File metadata and controls
38 lines (33 loc) · 2.06 KB
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
// A base tsconfig to be inherited (or used directly if component is for both browser and Node)
// NOTE vscode will warn about trailing commas in this file, but can ignore the warnings
{
"$schema": "https://json.schemastore.org/tsconfig",
"exclude": ["**/*.test.ts"],
"compilerOptions": {
// May need overriding
"lib": ["ESNext"], // Allow using latest JS features (add DOM & DOM.Iterable if browser)
"types": [], // Disables auto-including types modules of '@types/*' (add "node" if Node)
// Language expectations
"module": "ESNext", // Default to ESM and override manually when building for CJS
"target": "ESNext", // Manually specify target for each build type
"moduleResolution": "Node", // All should use node-like module resolution, not just node
// Other compilation settings
"declaration": true, // Emit declaration files
"resolveJsonModule": true, // Import JSON as objects
"esModuleInterop": true, // Make require imports work like es6 ones do
"experimentalDecorators": true, // Allow @decorators
"skipLibCheck": true, // Mostly avoids checking node_modules (but see docs)
"jsx": "preserve", // Volar needs for typechecking pug templates (for some reason)
// Strict checking
"strict": true,
"allowUnreachableCode": false, // Must be a mistake
"allowUnusedLabels": false, // Labels as in `continue *label*` for loops etc
"exactOptionalPropertyTypes": true, // {a:undefined} !== {}
"noImplicitOverride": true, // Must use `override` to make overriding parent class clear
"noImplicitReturns": true, // Must return a value unless void
"noPropertyAccessFromIndexSignature": true, // Must use `['a']` not `.a` if props unknown
"noUncheckedIndexedAccess": true, // If {[k:any]:type} consider `.k` = type|undefined
"noUnusedLocals": true, // Can't define variable and not use it
"noUnusedParameters": false, // It's ok to specify listener(event) and not use event
},
}