Skip to content

fix: resolve all knip issues#616

Merged
narthur merged 4 commits into
masterfrom
knip
Apr 3, 2026
Merged

fix: resolve all knip issues#616
narthur merged 4 commits into
masterfrom
knip

Conversation

@narthur

@narthur narthur commented Apr 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Deleted unused files: scripts/image-cache.ts (superseded by .mjs), scripts/onejson.ts, src/lib/getDom.ts
  • Removed 9 unused packages: findup-sync, sanitize-html, @anatine/zod-mock, @faker-js/faker, @types/findup-sync, @types/sanitize-html, concurrently, csv-parse, vite
  • Added missing dep @astrojs/check (required by astro check script)
  • Removed unused type exports: Props in both layouts (Astro doesn't require export), Month, DateString, PostInput, Status
  • Added knip.json config: entry points for src/scripts/*.ts and vitest.snapshot.diff.ts, ignore pixelmatch/pngjs (used via vitest mocks), ignore only-allow binary (invoked via npx)

Test plan

  • pnpm knip exits cleanly with no output
  • pnpm build succeeds
  • pnpm test passes

🤖 Generated with Claude Code

narthur and others added 2 commits April 3, 2026 10:52
- 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>
@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Accessibility Issues

Summary

No baseline issues found.

BaselineHead
00

Issue Breakdown

CodeBeforeAfterNet Change
View full breakdown

Ignored Codes

The 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.

@dreeves dreeves temporarily deployed to knip - beeblog PR #616 April 3, 2026 15:53 — with Render Destroyed
@narthur narthur marked this pull request as ready for review April 3, 2026 16:02
Copilot AI review requested due to automatic review settings April 3, 2026 16:02
@narthur narthur merged commit 803215a into master Apr 3, 2026
21 of 22 checks passed
@narthur narthur deleted the knip branch April 3, 2026 16:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 + knip with a new knip.json config.
  • 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.

Comment thread .github/workflows/ci.yaml
Comment on lines +146 to +148
knip:
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
runs-on: ubuntu-latest

Copilot AI Apr 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yaml
Comment on lines +154 to +162
- 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

Copilot AI Apr 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
narthur added a commit that referenced this pull request May 13, 2026
fix: resolve all knip issues
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.

3 participants