# `deslop/shadowed-directory`

Flag two directories that look like a forked/copied tree (e.g. src/ vs deno/lib/) sharing many duplicated same-named files.

- **Category:** Architecture
- **Severity:** warn
- **Source:** deslop-js
- **Framework:** global
- **Enabled when:** react-doctor deadCode analysis enabled (default true); whole-project scan only — skipped in --diff/--staged modes
- **Documentation:** <https://github.com/millionco/deslop-js>

## Validation prompt

Use this to decide whether a fired diagnostic is real or a false positive.

Fires as a ShadowedDirectoryPair when deslop collapses at least three two-file duplicate-block clusters that all live in the same directory pair (directoryA, directoryB) and have matching file basenames, reporting directoryA, directoryB, the sorted list of sharedFiles, and totalDuplicatedLines — its own doc comment frames this as the directories having drifted (e.g. src/ vs deno/lib/, a fork, or a copy-pasted route tree). False positive: the two trees are deliberately separate platform or runtime variants (ios/ vs android/, web/ vs native/, node/ vs deno/) or pinned versioned snapshots (v1/ vs v2/, a frozen vendored copy) where the overlap is intentional and the trees must evolve independently — suppress there.

## Fix prompt

Use this once validation confirms the diagnostic is real.

Reconcile the two trees instead of maintaining parallel copies: keep one directory as the source of truth, hoist the shared same-named files (the reported sharedFiles) into a single shared module, and have the second directory re-export or import from it, deleting the duplicated bodies (totalDuplicatedLines of them) so a change no longer has to be applied in both places. If the trees genuinely must differ, factor only the common core into a shared package and keep just the per-tree deltas. See https://github.com/millionco/deslop-js
