TypeScript Policy
Guardrails
- TypeScript everywhere (apps & packages)
- strict mode ON (
noImplicitAny,exactOptionalPropertyTypes, etc.) - ESMβfirst modules
- Path aliases + Project References enabled
- No decorators
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "Bundler",
"strict": true,
"jsx": "react-jsx",
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": { "@repo/*": ["packages/*/src"], "@ui/*": ["packages/ui/src/*"] }
},
"include": ["apps", "packages"]
}
{
"extends": "../../tsconfig.base.json",
"compilerOptions": { "composite": true, "outDir": "dist" },
"include": ["src"]
}
Build Tool: tsup for libraries and servers.
{
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": { "build": "tsup src/index.ts --dts --format esm,cjs" }
}
LLM Notes
- Always output ESM unless a dependency requires CJS; if dual-build, ship both.
- Respect path aliases. Import from
@repo/*rather than deep relative paths.
Exceptions
- Functions backend (
apps/functions/) currently uses modern ESM JavaScript per ADR 0001; TS may be introduced incrementally inshared/.