Skip to main content

Designing Safe Autofixes for eslint-plugin-repo

ยท One min read
Nick2bad4u
Project Maintainer

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 suggest when 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.