ADR 0010: Govern autofix behavior with safety-first defaults
- Status: Accepted
- Date: 2026-02-28
Contextâ
This plugin includes rules where some transformations are fully safe while others are report-only.
Autofix behavior must remain conservative and deterministic. If a rewrite is not provably safe in all supported contexts, the rule should report (or suggest) instead of automatically fixing.
Decisionâ
Adopt a formal autofix governance model:
- Rules should only emit
fixwhen safety is deterministic. - Rules should emit
suggestfor behavior-sensitive migrations. - Rule docs should specify whether a rule is report-only, suggestion-capable, or autofixable.
Rationaleâ
- Operational safety: automated rewrites must preserve semantics.
- Predictable rollout: teams can start with diagnostics and adopt fixes gradually.
- Consistent authoring: rule authors follow one shared safety bar for fixes.
Consequencesâ
- Fix behavior is intentionally policy-driven, not purely rule-local.
- Rule authors must classify rewrites as deterministic (
fix) vs contextual (suggest/report-only). - Migration playbooks can stage adoption by enabling presets in phases.
Revisit Triggersâ
Re-evaluate if:
- ESLint introduces stronger first-class fix governance primitives,
- the plugin requires finer-grained per-rule fix policy controls,
- or contributors report repeated unsafe-fix edge cases.