-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsconfig.json
More file actions
178 lines (156 loc) · 4.59 KB
/
tsconfig.json
File metadata and controls
178 lines (156 loc) · 4.59 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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
{
/**
* =============================================================================
* TYPESCRIPT CONFIGURATION
* =============================================================================
*
* This file tells TypeScript how to compile your code.
*
* WHAT IS TYPESCRIPT?
* TypeScript is JavaScript with types. It catches errors before runtime:
* - "This function expects a number but you passed a string"
* - "This property doesn't exist on this object"
* - "You forgot to handle null values"
*
* The TypeScript compiler (tsc) reads this config to know:
* - Which files to compile
* - What JavaScript version to output
* - How strict to be with type checking
*
* =============================================================================
*/
"compilerOptions": {
/**
* TARGET
* Which version of JavaScript to compile to.
* ES2020 is widely supported by modern browsers.
*/
"target": "ES2020",
/**
* USE DEFINE FOR CLASS FIELDS
* Uses the standard ECMAScript behavior for class fields.
* This ensures our code works correctly with modern JavaScript.
*/
"useDefineForClassFields": true,
/**
* LIB
* Which built-in type definitions to include.
* - ES2020: Core JavaScript features
* - DOM: Browser APIs (document, window, etc.)
* - DOM.Iterable: Iteration over DOM collections
*/
"lib": ["ES2020", "DOM", "DOM.Iterable"],
/**
* MODULE
* How modules are handled.
* ESNext uses modern import/export syntax.
*/
"module": "ESNext",
/**
* SKIP LIB CHECK
* Skip type checking of declaration files (.d.ts)
* This speeds up compilation and avoids issues with
* conflicting type definitions from different packages.
*/
"skipLibCheck": true,
/* ========== BUNDLER MODE OPTIONS ========== */
/**
* MODULE RESOLUTION
* How TypeScript finds modules when you import them.
* "bundler" mode works best with Vite.
*/
"moduleResolution": "bundler",
/**
* ALLOW IMPORTING TS EXTENSIONS
* Allows importing .ts and .tsx files directly.
*/
"allowImportingTsExtensions": true,
/**
* RESOLVE JSON MODULE
* Allows importing JSON files like: import data from './data.json'
*/
"resolveJsonModule": true,
/**
* ISOLATE MODULES
* Ensures each file can be compiled independently.
* Required for tools like Babel and ESBuild.
*/
"isolatedModules": true,
/**
* NO EMIT
* TypeScript won't output JavaScript files.
* We let Vite handle the actual compilation.
* TypeScript is just for type checking.
*/
"noEmit": true,
/**
* JSX
* How JSX syntax (<Component />) is handled.
* "react-jsx" uses the new JSX transform (React 17+)
* No need to import React in every file.
*/
"jsx": "react-jsx",
/* ========== STRICT TYPE CHECKING ========== */
/**
* STRICT
* Enables all strict type checking options.
* This catches more bugs but requires more precise code.
*/
"strict": true,
/**
* NO UNUSED LOCALS
* Warning on unused local variables (disabled for development).
*/
"noUnusedLocals": false,
/**
* NO UNUSED PARAMETERS
* Warning on unused function parameters (disabled for development).
*/
"noUnusedParameters": false,
/**
* TYPES
* Include type definitions for Vite and Node
*/
"types": ["vite/client"],
/**
* NO FALLTHROUGH CASES IN SWITCH
* Error when a switch case falls through without break.
* Prevents common bug where you forget 'break'.
*/
"noFallthroughCasesInSwitch": true,
/* ========== PATH ALIASES ========== */
/**
* BASE URL
* Base directory for resolving non-relative modules.
*/
"baseUrl": ".",
/**
* PATHS
* Map import paths to file locations.
* These must match the aliases in vite.config.ts!
*/
"paths": {
"@/*": ["src/*"],
"@components/*": ["src/components/*"],
"@stores/*": ["src/stores/*"],
"@types/*": ["src/types/*"],
"@engine/*": ["src/engine/*"],
"@db/*": ["src/db/*"],
"@utils/*": ["src/utils/*"],
"@hooks/*": ["src/hooks/*"],
"@themes/*": ["src/themes/*"],
"@services/*": ["src/services/*"]
}
},
/**
* INCLUDE
* Which files TypeScript should check.
* - "src" folder contains our application code
*/
"include": ["src"],
/**
* EXCLUDE
* Files to exclude from type checking.
*/
"exclude": ["node_modules", "dist"]
}