Skip to content

react-doctor: file/exports/types structure (files + exports + types + duplicates, 336 warnings) #269

@bntvllnt

Description

@bntvllnt

Source

`npx react-doctor . --json` — 336 warnings tagged Architecture.

Breakdown

Rule Count
`files` 327
`exports` 4
`types` 4
`duplicates` 1

Why this matters

`registry/default/` is duplicated from `src/components/` — scan flags both copies, doubling violation count and risking drift. Single-source-of-truth fix needed.

Sample

  • `registry.ts:0` — `files`
  • `styles.css:0`, `themes/default.css:0`, `lib/utils.ts:0` — `files`
  • `content/pages/{components,docs,home,philosophy}.mdx:0` — `files`
  • `components/component-preview/component-preview.tsx:0` — `files`
  • `registry/default/accordion/accordion.tsx:0` — `files`

Acceptance criteria

  • Run `pnpm doctor --explain registry.ts:0` to see what the `files` rule wants (likely co-location, naming, or barrel-export structure).
  • Adopt one canonical structure across the monorepo:
    • `packages/ui/src/components//{.tsx, .stories.tsx, .test.tsx, index.ts}`
    • `apps/registry/registry/default//` is generated from the above (no hand-edits).
  • Remove duplicate hand-edits from `registry/default/`. Verify `apps/registry/scripts/inline-component-source.ts` regenerates correctly.
  • Fix the 4 `exports` and 4 `types` violations individually.
  • `pnpm doctor` reports < 20 architecture warnings.

Memory note

This pairs with the existing "Repeating index.ts edit-not-applied snag" memory — barrel hygiene matters here.

Run

```bash
pnpm doctor --explain registry.ts:0
pnpm doctor --explain styles.css:0
```

Metadata

Metadata

Assignees

Labels

dxDeveloper experiencereact-doctorReported by react-doctor (codebase health)tech-debtRefactoring or cleanup

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions