From 001cbe393baa9f49437214746ebb015ca924e40e Mon Sep 17 00:00:00 2001 From: PerfectPan <24316656+PerfectPan@users.noreply.github.com> Date: Wed, 18 Nov 2026 22:07:57 +0800 Subject: [PATCH] ci(checks): run Knip on pull requests Co-Authored-By: Codex --- .github/pull_request_template.md | 1 + .github/workflows/ci.yml | 2 ++ .gitlab/merge_request_templates/default.md | 1 + AGENTS.md | 1 + CONTRIBUTING.md | 1 + README.md | 1 + 6 files changed, 7 insertions(+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e8225e9d..0b43f7f5 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -19,6 +19,7 @@ - [ ] Build: `pnpm build` - [ ] Typecheck: `pnpm typecheck` - [ ] Lint: `pnpm lint` (after build and typecheck) +- [ ] `pnpm knip` passes (unused files, exports, dependencies, configuration hints, or tag hints fail CI) - [ ] Changeset: `pnpm changeset status` (package-facing changes add a changeset) - [ ] Package dry-run: `npm pack --dry-run --registry=https://registry.npmjs.org` in each changed published package diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7586fa81..768e4c2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,3 +44,5 @@ jobs: # Type-aware lint resolves workspace packages through their built `dist` types # and room-web through the route types `pnpm typecheck` generates. - run: pnpm lint + + - run: pnpm knip diff --git a/.gitlab/merge_request_templates/default.md b/.gitlab/merge_request_templates/default.md index 356103fc..9b77404a 100644 --- a/.gitlab/merge_request_templates/default.md +++ b/.gitlab/merge_request_templates/default.md @@ -19,6 +19,7 @@ - [ ] Build: `pnpm build` - [ ] Typecheck: `pnpm typecheck` - [ ] Lint: `pnpm lint` (after build and typecheck) +- [ ] `pnpm knip` passes (unused files, exports, dependencies, configuration hints, or tag hints fail CI) - [ ] Changeset: `pnpm changeset status` (package-facing changes add a changeset) - [ ] Package dry-run: `npm pack --dry-run --registry=https://registry.npmjs.org` in each changed published package diff --git a/AGENTS.md b/AGENTS.md index ebd4ec57..97738b43 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -37,6 +37,7 @@ pnpm test pnpm build pnpm typecheck pnpm lint # after build and typecheck +pnpm knip # fails CI on unused files, exports, dependencies, configuration hints, or tag hints # Release checks: pnpm changeset status diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6210c3e8..81dd425b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,6 +57,7 @@ pnpm test pnpm build pnpm typecheck pnpm lint +pnpm knip # fails CI on unused files, exports, dependencies, configuration hints, or tag hints ``` `pnpm duplicates` runs jscpd with lint-config's gate profile, where any reported clone fails (the threshold is 0); the scan roots and ignores live in the script, and `pnpm duplicates:audit` writes a broader, report-only list to the git-ignored `tmp/duplicates-audit/`. `pnpm format` applies the formatting. `pnpm lint` is type-aware: it resolves workspace packages through their built `dist` types and room-web through the route types that `pnpm typecheck` generates, so run it after `pnpm build` and `pnpm typecheck`. diff --git a/README.md b/README.md index 996004f8..8eb96b55 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ The core package provides a local CLI that drives tasks from assignment through - `pnpm install` - `pnpm test` - `pnpm build` +- `pnpm knip` fails CI on unused files, exports, dependencies, configuration hints, or tag hints. - `pnpm changeset` ## License