Skip to content

Lint Packkit's own source (eat our own cooking)#20

Merged
DanMat merged 1 commit into
mainfrom
chore/self-enforcement
Jul 26, 2026
Merged

Lint Packkit's own source (eat our own cooking)#20
DanMat merged 1 commit into
mainfrom
chore/self-enforcement

Conversation

@DanMat

@DanMat DanMat commented Jul 26, 2026

Copy link
Copy Markdown
Owner

The "Packkit doesn't eat its own cooking" P0 from the architecture review. Packkit generated publint, strict TS, and lint gates for other people's packages, then ran none on itself.

It now lints its own source with the same stack it generates for users — eslint flat config + @eslint/js — via npm run lint, a check script (lint + test), and a CI lint job.

It earned its keep on the first run

ESLint found 16 issues immediately, including a genuine defect:

  • Duplicate minify key in the CLI arg parser (src/cli/args.js) — parseArgs silently tolerated it, but it's exactly the kind of thing that bites later.
  • Dead code: an always-empty expectApi ternary, an unused toJson import, an unused staged param threaded into lefthookYml, and leftover install/run locals in the monorepo generators.

All fixed. Generation output is unchanged (verified: lefthook.yml still emitted, test files present, fullstack still 37 files) and --minify still parses.

Scope decision

Full tsc --checkJs was assessed and deferred: 95 errors, nearly all the "incrementally-built object literal" pattern (Property 'outDir' does not exist on type {…}) — noise, not bugs. Not worth annotating around now. It did surface the dead reactEntry reference (removed in #18), which is the payoff that mattered. Recorded in the roadmap.

eslint clean, 87 tests pass.

🤖 Generated with Claude Code

Packkit generated publint, strict TS, and lint gates for other people's
packages but ran none on itself. It now lints its own source with the
same stack it generates for users — eslint flat config + @eslint/js —
via `npm run lint`, a `check` script (lint + test), and a CI lint job.

It immediately paid off, catching real issues on the first run:
- a duplicate `minify` key in the CLI arg parser (src/cli/args.js) —
  a genuine defect the parser silently tolerated;
- dead vars/imports: an always-empty `expectApi`, an unused `toJson`
  import, an unused `staged` param threaded into lefthookYml, and
  leftover `install`/`run` locals in the monorepo generators.

All fixed; generation output is unchanged (verified) and `--minify`
still parses. eslint is clean, 87 tests pass.

Full `tsc --checkJs` was assessed and deferred — 95 errors, almost all
the "incrementally-built object literal" pattern (noise) rather than real
bugs. Noted in the roadmap.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DanMat
DanMat merged commit f91b122 into main Jul 26, 2026
37 checks passed
@DanMat
DanMat deleted the chore/self-enforcement branch July 26, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant