-
Notifications
You must be signed in to change notification settings - Fork 3
fix: resolve all knip issues #616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -143,3 +143,20 @@ jobs: | |
| run: pnpm install | ||
| - name: Check outdated | ||
| run: pnpm outdated | ||
| knip: | ||
| if: github.event_name == 'push' || github.event.pull_request.head.repo.fork | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: pnpm/action-setup@v4.0.0 | ||
| with: | ||
| version: ${{ env.PNPM_VERSION }} | ||
| - 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 | ||
|
Comment on lines
+154
to
+162
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/knip@6/schema.json", | ||
| "tags": ["-lintignore"], | ||
| "entry": ["src/scripts/*.ts", "vitest.snapshot.diff.ts"], | ||
| "ignoreDependencies": [ | ||
| "pixelmatch", | ||
| "pngjs", | ||
| "@types/pixelmatch", | ||
| "@types/pngjs" | ||
| ], | ||
| "ignoreBinaries": ["only-allow"] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The job-level
ifcondition only evaluates to true forpushevents 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 checkgithub.event_name == 'push' || github.event_name == 'pull_request'(or remove the job-levelifand rely on the workflow triggers).