Designing Safe Autofixes for eslint-plugin-repo
ยท One min read
Autofix quality is a trust problem. A single unsafe fixer can make users disable an otherwise valuable rule.
Safety-first autofix principlesโ
- Prefer small, deterministic edits.
- Avoid fixers when intent cannot be inferred with high confidence.
- Use
suggestwhen multiple valid fixes exist.
Practical safeguardsโ
- Keep fixer ranges narrow and syntax-aware.
- Preserve comments and formatting boundaries.
- Test fixer output for parse validity and idempotence.
Safe autofixes improve adoption; risky autofixes undermine it.
