TypeScript Configuration
chant projects use a standard tsconfig.json. Nothing in it is chant-specific. chant reads your source with its own TypeScript, so this file is for your editor and tsc.
What chant init writes
Section titled “What chant init writes”{ "compilerOptions": { "target": "ES2022", "module": "esnext", "moduleResolution": "bundler", "types": ["node"], "strict": true, "esModuleInterop": true, "skipLibCheck": true, "declaration": true, "outDir": "./dist", "rootDir": "./src" }, "include": ["src"], "exclude": ["node_modules", "dist"]}The scaffolded package.json lists typescript as ^5.9.3 || ^7.0.0 and @types/node as ^24.0.0. npx tsc --noEmit passes on a fresh project under either TypeScript version.
Recommended Settings
Section titled “Recommended Settings”strict: true
Section titled “strict: true”Enables all strict type-checking options. In chant resource definitions it catches:
- Missing required properties on resources
- Incorrect property types
- Null/undefined assignment errors
moduleResolution: "bundler"
Section titled “moduleResolution: "bundler"”chant resolves imports the way bundler does, so import { config } from "./config" needs no file extension. NodeNext rejects that import with TS2835 and suggests ./config.js. Don’t take the suggestion, because chant does not map ./config.js back to ./config.ts, and the file is then run instead of folded.
types: ["node"]
Section titled “types: ["node"]”TypeScript 6 and later no longer load every @types package by default. Naming node keeps process.env and the node: modules typed.
Editor Integration
Section titled “Editor Integration”With tsconfig.json in place, your editor gives you:
- autocomplete for resource property names
- type errors for invalid property values
- go-to-definition into lexicon type definitions
- hover documentation for resource types