Repository navigation
Expand file tree
/
Copy pathtsconfig.json
More file actions
69 lines (55 loc) · 2.13 KB
/
Copy pathtsconfig.json
File metadata and controls
69 lines (55 loc) · 2.13 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
{
"compilerOptions": {
// ✅ Use the latest built-in JavaScript APIs (e.g., Promise, Map)
"lib": ["ESNext"],
// ✅ Compile to latest JS features
"target": "ESNext",
"module": "ESNext",
// ✅ Resolve modules like Node.js does
"moduleResolution": "node",
// ✅ Enables importing `.ts`, `.js`, etc. with extensions
"allowImportingTsExtensions": true,
// ✅ Allow importing .json files directly
"resolveJsonModule": true,
// ✅ Allow using JS files alongside TS (optional — remove if you’re TS-only)
"allowJs": true,
// ✅ Ensures import paths retain their extensions (important for Bun)
"verbatimModuleSyntax": true,
// ✅ Bun executes TypeScript directly — no need to emit JavaScript
"noEmit": true,
// ✅ Force type-checking of all modules (even if not explicitly imported)
"moduleDetection": "force",
// ✅ Allow CommonJS modules to work nicely with `import`
"esModuleInterop": true,
// ✅ Catch more bugs with strict type checks
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
// ✅ Optional: fine-tune unused checks
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false,
// ✅ Path aliases (for cleaner imports like `@/utils/logger`)
"baseUrl": "./src",
"paths": {
"@/config/*": ["config/*"],
"@/controllers/*": ["controllers/*"],
"@/libs/*": ["libs/*"],
"@/routes/*": ["routes/*"],
"@/middlewares/*": ["middlewares/*"],
"@/schemas/*": ["schemas/*"],
"@/services/*": ["services/*"],
"@/socket/*": ["socket/*"],
"@/templates/*": ["templates/*"],
"@/types/*": ["types/*"],
"@/utils/*": ["utils/*"]
},
// ✅ Allow modern test tools like Vitest to read ESM modules
"types": ["vitest/globals"]
},
// ✅ Tell the compiler where your source files live
"include": ["src", "src/types"],
// ✅ Tell the compiler not to compile files in node_modules
"exclude": ["node_modules","**/__tests__/**", "**/*.test.ts", "**/*.spec.ts"]
}