aboutsummaryrefslogtreecommitdiff
path: root/api/tsconfig.json
diff options
context:
space:
mode:
Diffstat (limited to 'api/tsconfig.json')
-rw-r--r--api/tsconfig.json37
1 files changed, 37 insertions, 0 deletions
diff --git a/api/tsconfig.json b/api/tsconfig.json
new file mode 100644
index 0000000..e11b6c1
--- /dev/null
+++ b/api/tsconfig.json
@@ -0,0 +1,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"]
+}