Skip to main content

ovecc fix

Applies the mechanical remediation for auto-fixable findings: deletes unreachable files, drops the export keyword on unused exports (pruning re-export lists), removes unused manifest dependencies, declares phantom dependencies with the version the lockfile already resolves, and deletes stale ovecc-ignore comments. All edits are format-preserving and re-validated.

Dry-run by default. Nothing is written without --apply.

Usage: ovecc fix [OPTIONS]

Example

$ ovecc fix
Fix plan: 10 change(s), 1 skipped — dry-run (pass --apply to write)

[planned] remove_unused_dependency — package.json:1 (unused-dependency)
remove "left-pad" from dependencies

[skipped] declare_dependency — package.json:2 (unlisted-dependency)
no lockfile version found for 'dayjs' — declare it manually

[planned] remove_unused_file — src/legacy/old-report.ts:1 (unused-file)
delete file (no entry point reaches it)

[planned] remove_unused_export — src/utils/helpers.ts:10 (unused-export)
- export function formatEuros(cents: number): string {
+ function formatEuros(cents: number): string {

[planned] remove_unused_export — src/core/db.ts:3 (unused-type)
- export interface Row {
+ interface Row {
...

Then:

$ ovecc fix --apply
Fix applied: 12 change(s), 1 skipped — applied

Options

OptionEffect
--applyWrite the changes (default is a dry-run preview)
--rule <rule>Only fix findings from this rule (e.g. unused-export, unused-file)

Plus the global options.

Safety model

  • Dry-run first. The plan shows the exact diff per edit before anything happens.
  • Re-verification. On --apply, every edit re-checks the file against the index; stale entries (the file changed since the last ovecc index) are skipped with a reason instead of blind-edited.
  • No judgement calls. Default exports, architectural smells, security findings — anything requiring human judgement is never touched. When fix can't be certain (e.g. a phantom dependency with no lockfile version), it skips and tells you rather than guessing.
  • Format-preserving. JSON files (like package.json) are validated after editing; source edits change only the tokens they must.

Typical loop

ovecc fix # read the plan
ovecc fix --apply # apply it
ovecc index . && ovecc review # confirm: the change introduces no new defects