Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Silencing the checker: type escapes and suppressions
card 1 of 6
Green build in two minutes, after 14 errors
builds on: Agents optimise the signal they can see
You renamed a field and asked the agent to make `tsc` pass. Two minutes later it reports: "Fixed all 14 type errors, build is green." The diff is short. It is mostly a few `as`, a `!` and one `// @ts-ignore`. In Python the same moment shows up as `# type: ignore`. In Go, it shows up as a parameter widened to `any`. Were the errors fixed, or just silenced?
Terms on this card
- tsc
- The TypeScript compiler. It type-checks TS code and reports type errors.
- `any`
- In TS, a type that switches off checking for that value. In Go, an alias for `interface{}`: a value of any type, checked only at runtime.
- `# type: ignore`
- A Python comment that makes type checkers like mypy skip errors on its line. `# type: ignore[code]` limits it to one error code.
- the agent
- The AI coding system doing the work: a chat assistant, IDE agent or terminal agent.
- diff
- The set of line changes between two versions of the code: removed lines start with '-', added lines with '+'.
Lesson goal: Spot the escape hatches that silence the compiler or linter instead of fixing the problem: `any`, `as`, non-null `!` and `@ts-ignore` in TS; `# type: ignore` and `cast` in Python; `@SuppressWarnings("unchecked")` in Java; `any`/`interface{}` in Go; `unsafe`; and `eslint-disable`, `//nolint`, `#[allow]`. Explain which guarantee each one removes. ·
the whole lesson