Type-Aware Linting Without Surprises
ยท 2 min read
Type-aware rules are powerful, but they become noisy fast when parser-service assumptions are unclear.
The goal is not โrun typed rules everywhere immediately.โ The goal is predictable behavior under real project conditions.
The contract we wantโ
A healthy typed-rule setup has three explicit outcomes:
- Typed path available: semantic checks run with parser services + checker.
- Optional typed path unavailable: semantic branch is skipped safely.
- Required typed path unavailable: fail fast with a clear configuration signal.
That split keeps failures actionable and prevents silent drift.
Why guard-first design mattersโ
In large codebases, parser-service availability is not uniform:
- different
tsconfigscopes - mixed package boundaries
- generated or excluded files
Guard-first execution avoids brittle behavior by making typed entry conditions explicit.
Rollout pattern that worksโ
- Start in one folder/package.
- Measure with
--statsbefore and after enabling typed checks. - Promote from
warntoerroronce baseline noise is gone. - Expand scope only when performance and diagnostics stay stable.
What to trackโ
- typed-rule error rate tied to config gaps
- lint runtime deltas after enabling typed presets
- rule-level hotspots that call checker APIs most often
If those stay stable, typed linting remains a quality upgrade instead of a workflow tax.
