aboutsummaryrefslogtreecommitdiff
path: root/api/tsconfig.json
blob: e11b6c1a18a55ac0ae6fc92a74bf1a23ff4658e6 (plain)
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
{
  "compilerOptions": {
    // ── Compilação ────────────────────────────────────────────────────────────
    "target": "ES2022",              // Node 20 suporta ES2022 nativamente
    "module": "ESNext",              // Saída em ESModules (alinhado com "type":"module")
    "moduleResolution": "bundler",   // Compatível com tsx (dev) e esbuild/tsc (prod)
    "lib": ["ES2022"],

    // ── Saída ─────────────────────────────────────────────────────────────────
    "outDir": "./dist",
    "rootDir": "./src",
    "declaration": true,             // Gera .d.ts para uso interno entre módulos
    "sourceMap": true,               // Facilita debug em desenvolvimento

    // ── Strict Mode (obrigatório para código limpo) ────────────────────────────
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "noImplicitOverride": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,

    // ── Interoperabilidade ────────────────────────────────────────────────────
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "resolveJsonModule": true,
    "verbatimModuleSyntax": true,    // Força import type onde necessário

    // ── Path Aliases ──────────────────────────────────────────────────────────
    // Permite imports como: import { db } from '@/db/connection'
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"]
    }
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist"]
}