-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsconfig.json
87 lines (80 loc) · 5.49 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
{
"compilerOptions": {
// -------------------
// Section 1: Projects
// -------------------
// "incremental": true, // Save .tsbuildinfo files to allow for incremental compilation of projects.
// -----------------------------------
// Section 2: Language and Environment
// -----------------------------------
"target": "ESNext", // default value is "ES3"
"jsx": "react-jsx",
"lib": ["ES2022"], // adding the "DOM" library helps vs-code to recognize the window & document objects.
// ------------------
// Section 3: Modules
// ------------------
"module": "ESNext",
"moduleResolution": "Node", // Possible values: "Node", "Node16", "NodeNext"
"resolveJsonModule": true,
"baseUrl": "./",
"paths": {},
"typeRoots": ["node_modules/@types"],
// -----------------------------
// Section 4: JavaScript Support
// -----------------------------
"checkJs": true, // without it? this config file would not apply to js/jsx files.
"maxNodeModuleJsDepth": 0, // Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'.
// ---------------
// Section 5: Emit
// ---------------
"noEmit": true, // <--- defaults to true. Disable emitting files from a compilation.
// "declaration": true, // Generate .d.ts files from TypeScript and JavaScript files in your project.
// "declarationMap": true, // Create sourcemaps for d.ts files.
// "emitDeclarationOnly": true, // Only output d.ts files and not JavaScript files.
// "sourceMap": false, // default value is false. Create source map files for emitted JavaScript files.
// "outDir": "./dist/lib", // Specify an output folder for all emitted files.
// "noEmitOnError": true, // Disable emitting files if any type checking errors are reported.
// "removeComments": true, // Disable emitting comments.
// "verbatimModuleSyntax": true,
// "declarationDir": "./dist", // Specify the output directory for generated declaration files.
// "outFile": "./src/index.d.ts", // Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output.
// ------------------------------
// Section 6: Interop Constraints
// ------------------------------
"isolatedModules": true, // <--- Setting the isolatedModules flag tells TypeScript to warn you if you write certain code that can’t be correctly interpreted by a single-file transpilation process.
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
// "preserveSymlinks": true, // <--- Solved being redirected to node_modules/.pnpm symlink all the time! Disable resolving symlinks to their realpath. This correlates to the same flag in node. But on the other-hand, I wasn't able to import Page as type from playwright in jsdoc.
// ------------------------
// Section 7: Type Checking
// ------------------------
"noImplicitOverride": true, // If you use inheritance, and you provide an override function, you must specify that it is an override function.
// "strict": true // <--- Enable all strict type-checking options.
"noImplicitAny": false, // <--- Enable error reporting for expressions and declarations with an implied 'any' type.
"strictNullChecks": true, // When type checking, take into account 'null' and 'undefined'. */
"strictFunctionTypes": true, // When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
"strictBindCallApply": true, // Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
"strictPropertyInitialization": true, // Check for class properties that are declared but not set in the constructor. */
"noImplicitThis": true, // Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
"alwaysStrict": true, // Ensure 'use strict' is always emitted. */
// "noUnusedLocals": true, // Enable error reporting when local variables aren't read.
// "noUnusedParameters": true, // Raise an error when a function parameter isn't read.
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
// -----------------------
// Section 8: Completeness
// -----------------------
"skipLibCheck": true
},
"compileOnSave": true,
"exclude": ["node_modules"],
"include": ["src"]
}