Conversation
- Delete unused files (image-cache.ts, onejson.ts, getDom.ts) - Remove unused deps: findup-sync, sanitize-html, @anatine/zod-mock, @faker-js/faker, @types/findup-sync, @types/sanitize-html, concurrently, csv-parse, vite - Add missing dep: @astrojs/check - Remove unused type exports: Props (layouts), Month, DateString, PostInput, Status - Configure knip: entry points for src/scripts/*.ts and vitest.snapshot.diff.ts, ignore pixelmatch/pngjs/only-allow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Accessibility IssuesSummaryNo baseline issues found.
Issue Breakdown
Ignored CodesThe following codes are ignored, and will not result in a CI failure. The following ignored codes were not found in this PR. Please consider removing them from the list of ignored codes. |
There was a problem hiding this comment.
Pull request overview
Removes unused code and dependencies to make knip pass cleanly, and adds Knip configuration plus CI coverage.
Changes:
- Deleted unused scripts/libs and removed unused exported types.
- Removed unused dependencies/devDependencies and added
@astrojs/check+knipwith a newknip.jsonconfig. - Added a dedicated Knip job to the GitHub Actions CI workflow.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/schemas/status.ts | Removes unused exported Status type. |
| src/schemas/post.ts | Removes unused exported PostInput type. |
| src/schemas/dateString.ts | Removes unused exported DateString type. |
| src/lib/getDom.ts | Deletes unused DOM helper module. |
| src/lib/getArchives.ts | Makes Month type internal (non-exported). |
| src/layouts/Paginated.astro | Makes Props interface internal (non-exported). |
| src/layouts/Layout.astro | Makes Props interface internal (non-exported). |
| scripts/onejson.ts | Deletes unused one-off CSV conversion script. |
| scripts/image-cache.ts | Deletes superseded TS script (replaced by .mjs). |
| package.json | Removes unused deps, adds @astrojs/check + knip, adds pnpm knip script. |
| pnpm-lock.yaml | Lockfile updates reflecting dependency changes. |
| knip.json | Adds Knip configuration (entries + ignores). |
| .github/workflows/ci.yaml | Adds a Knip CI job. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| knip: | ||
| if: github.event_name == 'push' || github.event.pull_request.head.repo.fork | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
The job-level if condition only evaluates to true for push events or PRs from forks (github.event.pull_request.head.repo.fork). This will skip running Knip (and the other jobs using the same condition) for pull requests coming from branches within the same repository. If the intent is to run on all PRs, update the condition to check github.event_name == 'push' || github.event_name == 'pull_request' (or remove the job-level if and rely on the workflow triggers).
| - name: Use Node.js ${{ env.NODE_VERSION }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: "pnpm" | ||
| - name: Install | ||
| run: pnpm install | ||
| - name: Knip | ||
| run: pnpm knip |
There was a problem hiding this comment.
knip@6.3.0 declares engines: { node: ^20.19.0 || >=22.12.0 } (per pnpm-lock.yaml), but this workflow installs Node using NODE_VERSION: "20". Depending on what actions/setup-node resolves to, pnpm knip can fail with an engine/runtime mismatch on older 20.x versions. Consider pinning NODE_VERSION to 20.19.0+ (or moving CI to Node 22+) so the Knip job is consistently runnable.
Summary
scripts/image-cache.ts(superseded by.mjs),scripts/onejson.ts,src/lib/getDom.tsfindup-sync,sanitize-html,@anatine/zod-mock,@faker-js/faker,@types/findup-sync,@types/sanitize-html,concurrently,csv-parse,vite@astrojs/check(required byastro checkscript)Propsin both layouts (Astro doesn't requireexport),Month,DateString,PostInput,Statusknip.jsonconfig: entry points forsrc/scripts/*.tsandvitest.snapshot.diff.ts, ignorepixelmatch/pngjs(used via vitest mocks), ignoreonly-allowbinary (invoked vianpx)Test plan
pnpm knipexits cleanly with no outputpnpm buildsucceedspnpm testpasses🤖 Generated with Claude Code