-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsconfig.base.json
99 lines (72 loc) · 3.85 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
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
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
// always strict for maximum type safety
"strict": true,
"strictNullChecks": true,
"strictBindCallApply": true,
"noImplicitAny": true,
// emit types and source maps
"declaration": true,
"declarationMap": true,
"sourceMap": true,
// set default target and module for repo
"target": "ESNext",
"module": "ESNext",
"lib": ["ES2022", "ES2022.Intl"], // add ["DOM", "DOM.Iterable"] for front-end projects
"useDefineForClassFields": true,
// enable colorized terminal output for readability
"pretty": true,
// preserve jsdoc comments for intellisense
"removeComments": false,
// enable module resolution without file extensions on relative paths for things like npm package imports.
"moduleResolution": "bundler",
// https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-imports-and-self-name-imports
"resolvePackageJsonImports": true,
// allow json imports
"resolveJsonModule": true,
// enforce the usage of type-only imports when needed to avoid bundling issues and improve performance
"verbatimModuleSyntax": true,
// ensure that each file can be transpiled without relying on other imports
// this is redundant with the previous option however it ensures that it's on even if someone disables `verbatimModuleSyntax`
"isolatedModules": true,
// report an error when importing a file using a casing different from another import of the same file
"forceConsistentCasingInFileNames": true,
// properly support importing CJS modules in ESM
"esModuleInterop": true,
// skip typechecking libraries and .d.ts files for faster builds (and not deal with upstream type issues)
"skipLibCheck": true,
// allow JavaScript files to be imported (for example supports autocompletion in *.config.mjs files)
"allowJs": true,
// allow JSX files (or files that are internally considered JSX such as Astro files) to be imported inside `.js` and `.ts` files.
"jsx": "preserve",
// use the following jsx configuration for astro projects and react component libraries/packages
// "jsx": "react-jsx",
// "jsxImportSource": "react",
// enforce function types
"strictFunctionTypes": true,
// enforce that all class properties must be initialized in the constructor
"strictPropertyInitialization": false,
// a less restrictive eslint rule is used instead that allows unused locals if prefixed with an underscore
"noUnusedLocals": false,
// report an error when a parameter is declared but never used (set to `false` to prefer the eslint rule instead)
"noUnusedParameters": true,
// report an error when `undefined` is given to an optional property that doesn't include `undefined` in its type
// react projects may want to override to `false` to support common props and stylng patterns with JSX
"exactOptionalPropertyTypes": true,
// report errors for fallthrough cases in switch statements (this helps eliminate bugs and improve code quality)
"noFallthroughCasesInSwitch": true,
// force functions designed to override their parent class to be specified as `override`
"noImplicitOverride": true,
// force functions to specify that they can return `undefined` if a possible code path does not return a value
"noImplicitReturns": true,
// force the usage of the indexed syntax to access fields declared using an index signature
"noUncheckedIndexedAccess": true,
// report an error for unused labels instead of just a warning
"allowUnusedLabels": false,
// early returns are often used in dev/debug workflows so consider `true` for developer ergonomics
"allowUnreachableCode": false
},
// include @total-typescript reset for global type enhancements
"include": ["reset.d.ts"]
}