Skip to content

TypeScript Configuration

llms.txt lists every page for an agent

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.

{
"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.

Enables all strict type-checking options. In chant resource definitions it catches:

  • Missing required properties on resources
  • Incorrect property types
  • Null/undefined assignment errors

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.

TypeScript 6 and later no longer load every @types package by default. Naming node keeps process.env and the node: modules typed.

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

chant