-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtsconfig.json
More file actions
49 lines (38 loc) · 1.95 KB
/
tsconfig.json
File metadata and controls
49 lines (38 loc) · 1.95 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
39
40
41
42
43
44
45
46
47
48
49
{
//Inherits settings from ../tsconfig.all.jsonc which is at root level
"extends": ["../../tsconfig.all.jsonc"],
//Tells TypeScript to only compile files inside the src/ folder and its subdirectories.
//It includes .ts, .tsx, .js, and .jsx
"include": ["src/**/*"],
//compilerOptions inherited from tsconfig.all.jsonc are overridden here.
// i have taken reference from spark/web compilerOptions.In that also we are overridding
"compilerOptions": {
//Provides Node.js global types and includes types for Vitest which is used by test files
"types": ["node", "vitest"],
"outDir": "dist", // Output directory for compiled files
//same as what we do in Spark , a node_modules folder at root level , with in a subfolder named 'export'
"tsBuildInfoFile": "../../node_modules/.buildinfo/export",
//Allows TypeScript to compile JavaScript files
"allowJs": true,
//Disables type checking on .js files.
"checkJs": false,
//Ensures that functions always return a value.for example there is whole code of function wrapped under IF statment,
//then it will throw Error: Not all code paths return a value.
"noImplicitReturns": true,
//Forces explicit undefined checks when accessing arrays or objects.
//for example let x = arr[0]; // Error: x might be undefined.
//to fix this let x: number[] | undefined or let x = arr[0] as number;
"noUncheckedIndexedAccess": true,
//Ensures function parameters are used.// Error: 'name' is unused.
"noUnusedParameters": true,
//strict it self holds 6 different type of checks
//strictNullChecks-Error: Type 'null' is not assignable to 'string'
//noImplicitAny-Error: Parameter 'name' implicitly has an 'any' type
//strictFunctionTypes-Error: Type '(age: number) => void' is not assignable to type '(name: string) => void'
//strictBindCallApply-
//strictPropertyInitialization-
//noImplicitThis-
"strict": true,
"isolatedModules": true
}
}