AgentLint Verified 100/1001,533 TypeScript repos analyzed

    TypeScript CLAUDE.md & AGENTS.md Template

    Strict types, fast Vitest loops, and ESM/CJS boundaries distilled from 1,533 TypeScript repos.

    # TypeScript Project — TypeScript Harness
    
    TypeScript application using pnpm, Vitest, ESLint, and strict compiler checks.
    
    ## Commands
    
    - Install: `pnpm install --frozen-lockfile`
    - Fast single test: `npx vitest run src/path/to/file.test.ts`
    - Full test suite: `pnpm test`
    - Typecheck & lint: `npx tsc --noEmit && pnpm lint`
    - Production build: `pnpm build`
    
    ## Rules
    
    - Don't use `any`, `@ts-ignore`, or `as unknown as` to silence compiler errors. Instead narrow types or parse external inputs with Zod. Because unchecked casts hide runtime null crashes.
    - Don't mix package managers. Instead use `pnpm` exclusively. Because competing lockfiles break CI caching and reproducible builds.
    - Don't run the full E2E suite during unit edits. Instead run the targeted Vitest file command above. Because full E2E takes minutes and stalls iteration.
    - When changing API schemas or shared types, read `docs/api-contracts.md` before editing handlers.
    
    ## Continuity & Safety
    
    - Keep `.env` and `CLAUDE.local.md` in `.gitignore` — never commit secrets or personal machine paths.
    - Update `HANDOFF.md` with verified test commands before ending a multi-step session.

    Most Adopted TypeScript Rules Across Real Open-Source Repos

    Measured across 1,533 public TypeScript repositories in the 4,533-repo harness study:

    reactframework

    React for UI

    61.3%940 repos
    npmtooling

    npm package manager

    41.8%641 repos
    tailwindcsstooling

    Tailwind CSS for styling

    38.8%595 repos
    unit-teststesting

    Write unit tests for all changes

    37.6%577 repos
    eslinttooling

    ESLint for linting

    36.9%565 repos
    error-handlingpatterns

    Proper error handling with context

    34.0%521 repos
    vitesttesting

    Vitest for testing

    32.6%499 repos
    nextjsframework

    Next.js framework

    28.6%439 repos
    Essential Commands (Checks W1 & W7)
    install
    pnpm install
    fastTest
    npx vitest run src/path/to/unit.test.ts
    fullTest
    pnpm test
    lint
    pnpm lint && npx tsc --noEmit
    build
    pnpm build
    Common TypeScript Agent Pitfalls
    • 01Agents silently insert any or @ts-ignore to make typechecks pass unless explicitly prohibited with a reason.
    • 02Mixing npm, yarn, and pnpm lockfiles breaks CI determinism.
    • 03Unscoped tsc watch commands stall headless agent sessions; always use tsc --noEmit.

    More Verified Stack Templates