Doctor · duplication

DOC0009Review repeated token sequences

Two or more source files contain a matching normalized token window.
vite-doctor/coreduplicationinfoNo fix
workspace/duplication/exact-clonesrc/core/internal/workspace-graph.ts

Why it happens

Doctor hashes windows of 30 tokens at 10-token intervals after normalizing numeric values. A shared hash identifies a possible clone across files. This heuristic does not establish equivalent behavior or require the entire files to match.

Fix

Compare the primary file with the related files. Extract shared behavior when the copies should evolve together. Keep independent implementations when their duplication is intentional and configure a scoped suppression if needed.

Verify the fix

Rerun the workspace analysis after editing:

pnpm vite-doctor . --analyses dupes
  • workspace/duplication/exact-clone
Copyright © 2026