Skip to content

fix: resolve knip false positives blocking pre-commit hook#253

Merged
atilafassina merged 2 commits intomainfrom
fix/knip-unused-deps
Apr 9, 2026
Merged

fix: resolve knip false positives blocking pre-commit hook#253
atilafassina merged 2 commits intomainfrom
fix/knip-unused-deps

Conversation

@jamesbroadhead
Copy link
Copy Markdown
Contributor

Summary

  • The knip check in the pre-commit hook fails on every commit due to false positives
  • globals.css is reported as unused (knip doesn't trace CSS files, but it's used by build config and package exports)
  • tailwindcss and tw-animate-css are reported as unused devDeps (imported via CSS @import in globals.css)
  • json-schema-to-typescript is reported as unused (used in tools/generate-schema-types.ts, but tools/** is in knip's file ignore list)
  • Adds appropriate ignore rules to knip.json for all four false positives

Test plan

  • pnpm knip passes cleanly after the change
  • Pre-commit hook passes

This pull request was AI-assisted by Isaac.

…cies

knip doesn't trace CSS @import directives or files in ignored
directories, causing false positives for:
- globals.css (used by build config and package exports)
- tailwindcss/tw-animate-css (imported in globals.css)
- json-schema-to-typescript (used in tools/generate-schema-types.ts)

Co-authored-by: Isaac
@jamesbroadhead jamesbroadhead requested a review from pkosiec April 7, 2026 16:51
Copy link
Copy Markdown
Contributor

@atilafassina atilafassina left a comment

Choose a reason for hiding this comment

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

LGTM. All four false positives are verified — CSS @import deps, CSS file tracking, and tools/ dependency are all genuine knip limitations. Explored switching tools/** from ignore to entry points but it surfaces more noise (unused file false positives for standalone scripts). The current approach is the pragmatic choice.

@atilafassina atilafassina merged commit 24ab159 into main Apr 9, 2026
10 of 14 checks passed
@atilafassina atilafassina deleted the fix/knip-unused-deps branch April 9, 2026 14:14
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.

2 participants