core: split mod-check/scope-walk.ts by responsibility

Offen
#199 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
68/100
Issue-Typ
Refactoring
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
devtools

Rechercherichtung

Read packages/core/src/mod-check/scope-walk.ts and the imports in packages/core/src/mod-check.ts and packages/core/src/mod-check.test.ts; use closed issue #142 and PR #196 as references for the split and verification approach. Keep function bodies and types unchanged, preserve the collectUses and isBound imports, and ensure the new modules and original file are each at most 500 lines. Run the listed lint, test, mod:check, and e2e commands, then compare the public exports and distribution and tarball file lists.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement
Problem

packages/core/src/mod-check/scope-walk.ts has about 609 lines after PR #198 (alias, write and for-of tracking). oxlint reports landmines(max-file-lines): This file has 609 lines (limit 500). Split it by responsibility. on every pnpm lint run. The file mixes scope construction and binding lookup, access collection (member, destructuring, for-of heads) and the alias and write resolution. Closed issue #142 split mod-check.ts the same way; this file was left whole on purpose in PR #198 to keep that PR a behavior change only.

Proposal

Split scope-walk.ts into modules under packages/core/src/mod-check/ by responsibility, for example scope and binding lookup (scope.ts), access collection, and alias and write resolution, keeping collectUses and isBound importable from scope-walk.ts so mod-check.ts and the tests keep their imports. Recommendation: a pure move, keep every function body and type byte for byte, add no export to packages/core/src/index.ts, keep each new file under 500 lines and the mod-check/ folder within the file-count limit the lint enforces. Verify like PR #196: the Object.keys and ^export lines of packages/core/dist/index.d.mts, the dist file list and the tarball file lists of the five packages stay identical before and after.

Design points

No response

Package

core

Scope

packages/core/src/mod-check/ (scope-walk.ts and the new modules) and the imports in packages/core/src/mod-check.ts and packages/core/src/mod-check.test.ts only. Changeset: empty (no user-visible change).

Acceptance
  • pnpm lint no longer reports max-file-lines for any file under packages/core/src/mod-check/, and reports no new warning.
  • packages/core/src/mod-check/scope-walk.ts and every new module are at most 500 lines.
  • The public exports, the dist file list and the tarball file lists of the five packages are unchanged.
  • pnpm test, pnpm mod:check and pnpm test:e2e pass with the goldens under fixtures/*/expected/ unchanged.
Relations
  • Originating PR: #198
Vorherrschende Sprache
TypeScript
Sterne
0
Forks
0
Ø Merge
29 Min.
Gemergte PRs (30 T.)
138

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus kwitsch/claude-code-plugin-tooling

Alle Issues in kwitsch/claude-code-plugin-tooling

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.