-
Notifications
You must be signed in to change notification settings - Fork 2
/
tsconfig.json
46 lines (43 loc) · 2.23 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
{
"include": [
"./**/*.ts",
"./components/**/*.ts",
"./react-components/**/*.ts",
"./react-components/**/*.tsx"
],
"exclude": ["node_modules/**/*", "dist", "twig"],
"compilerOptions": {
"lib": ["ESNext", "dom", "dom.iterable"],
"removeComments": true,
"target": "ES2022",
"outDir": "dist",
// Module resolution
"baseUrl": "./", // Lets you set a base directory to resolve non-absolute module names.
"module": "commonjs" /* Specify what module code is generated. */,
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
"strict": true /* Enable all strict type-checking options. */,
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"jsx": "react-jsx",
"moduleResolution": "node", // Pretty much always node for modern JS. Other option is "classic"
"paths": {
"@components/*": ["./components/*"],
"@react/*": ["./react-components/*"],
"@utils/*": ["./assets/js/utils/*"],
"@assets/*": ["./assets/*"]
},
// Source Map
"sourceMap": true, // enables the use of source maps for debuggers and error reporting etc
"sourceRoot": "/", // Specify the location where a debugger should locate TypeScript files instead of relative source locations.
// Strict Checks
"alwaysStrict": true, // Ensures that your files are parsed in the ECMAScript strict mode, and emit “use strict” for each source file.
"allowUnreachableCode": false, // pick up dead code paths
"noImplicitAny": true, // In some cases where no type annotations are present, TypeScript will fall back to a type of any for a variable when it cannot infer the type.
"strictNullChecks": true, // When strictNullChecks is true, null and undefined have their own distinct types and you’ll get a type error if you try to use them where a concrete value is expected.
// Linter Checks
"noImplicitReturns": true,
"noUncheckedIndexedAccess": true, // accessing index must always check for undefined
"allowJs": true,
"noUnusedLocals": false
}
}