Presets in CDAL
Presets provide curated, battle-tested forbidden patterns, verification commands, and file scopes.
// cdal.config.mjs
export default defineConfig({
presets: ['typescript-strict', 'nextjs', 'safe-defaults'],
});
1. typescript-strict
Eliminates type silencing and evasive casting in production code.
- Forbidden Patterns:
@ts-ignoreand@ts-expect-errorinsrc/orapp/as anyand double casting (as unknown as any)- Isolated and muted tests:
describe.only,it.only,test.skip
- Gate Evasion Probes:
- Blocks string split evasion:
['@ts', 'ignore'].join('')or"@" + "ts-ignore" - Blocks double recast evasion:
as unknown as PrismaClient
- Blocks string split evasion:
2. nextjs
Guardrails tailored for Next.js App Router applications.
- Forbidden Patterns:
- Hardcoded internal color hex values in components (enforces CSS design tokens).
- Secret keys in client-side bundles (e.g.
SUPABASE_SERVICE_ROLE_KEYorsk_live_inapp/). - Missing server/client component boundaries.
3. safe-defaults (Bash Guard)
Prevents destructive or irreversible shell commands during automated agent runs:
rm -rf /or recursive deletions of root directoriesgit push --forceto protected branches- Direct
npm publishwithout human approval