-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsconfig.json
More file actions
49 lines (45 loc) · 2.75 KB
/
Copy pathtsconfig.json
File metadata and controls
49 lines (45 loc) · 2.75 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
{
"compilerOptions": {
// ── Output ──────────────────────────────────────────────────────────────
"target": "ES2022", // Modern JS — supports top-level await, etc.
"module": "CommonJS", // Node.js module system (require/exports)
"outDir": "dist", // Compiled JS lands here
"rootDir": "src", // Source lives here
// ── Strict Mode (never turn these off) ──────────────────────────────────
"strict": true, // Master switch for all strict checks
"noImplicitAny": true, // Ban implicit 'any' types
"strictNullChecks": true, // null/undefined must be handled explicitly
"noImplicitReturns": true, // Every code path must return a value
"noFallthroughCasesInSwitch": true,
// ── Module Resolution ────────────────────────────────────────────────────
"moduleResolution": "Node",
"esModuleInterop": true, // Allows: import express from 'express'
"resolveJsonModule": true, // Allows: import pkg from './package.json'
"allowSyntheticDefaultImports": true,
// ── Path Aliases ─────────────────────────────────────────────────────────
// Instead of: import { env } from '../../../config/env'
// You write: import { env } from '@config/env'
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"@config/*": ["src/config/*"],
"@controllers/*": ["src/controllers/*"],
"@services/*": ["src/services/*"],
"@repositories/*": ["src/repositories/*"],
"@middlewares/*": ["src/middlewares/*"],
"@routes/*": ["src/routes/*"],
"@utils/*": ["src/utils/*"],
"@errors/*": ["src/errors/*"],
"@validations/*": ["src/validations/*"],
"@constants/*": ["src/constants/*"],
"@types/*": ["src/types/*"]
},
// ── Quality & Output ─────────────────────────────────────────────────────
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true, // Skip type-checking node_modules (faster)
"declaration": true, // Emit .d.ts files
"sourceMap": true // Source maps for debugging
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "src/**/__tests__/**"]
}