Skip to content

Setup Knip for dead code detection#239

Merged
Paveltarno merged 7 commits intomainfrom
setup-knip
Feb 12, 2026
Merged

Setup Knip for dead code detection#239
Paveltarno merged 7 commits intomainfrom
setup-knip

Conversation

@Paveltarno
Copy link
Collaborator

@Paveltarno Paveltarno commented Feb 12, 2026

Note

Description

This PR integrates Knip for automated dead code detection and unused export elimination. Knip is added as a development tool with CI integration, Claude Code hooks for automatic fixes, and initial cleanup of detected unused code across the codebase.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Added Knip dependency (v5.83.1) with configuration in knip.json
  • Created GitHub Actions workflow .github/workflows/knip.yml for CI checks
  • Added Claude Code settings with post-edit hooks to run knip:fix, lint:fix, and typecheck
  • Removed unused exports and type definitions across multiple modules:
    • Removed unused POSTHOG_SHUTDOWN_TIMEOUT_MS, shutdownPostHog(), and related PostHog exports
    • Removed unused type exports: OAuthError, TemplatesConfig, SiteConfig, CreateProjectResponse, etc.
    • Removed unused functions: requireAuth(), findAppConfigPath(), generateAgentConfigContent(), etc.
    • Removed unused interface exports: RunCommandOptions, CLIErrorOptions, ApiErrorOptions, etc.
    • Removed @types/tar dev dependency (unused)
  • Updated msw from 2.12.7 to 2.12.10
  • Added .worktrees to .gitignore
  • Updated package.json with knip and knip:fix scripts

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated AGENTS.md if I made architectural changes

Additional Notes

The Knip configuration targets entry points at src/cli/index.ts and tests/**/testkit/index.ts, scanning all TypeScript files in src/ and tests/ while ignoring dist/ and test fixtures. The Claude Code hooks enable automatic dead code detection and fixes during development, improving code quality and maintainability.


🤖 Generated by Claude | 2026-02-12 19:15 UTC

@github-actions
Copy link
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.31-pr.239.ae9c273

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.31-pr.239.ae9c273"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.31-pr.239.ae9c273"
  }
}

Preview published to npm registry — try new features instantly!

@claude
Copy link

claude bot commented Feb 12, 2026

README check ran. 3 issue(s) found and applied: updated deploy command description to match code, updated logout command description to match code, uncommented eject command row (it is registered and not hidden). README.md has been updated in this branch.

@Paveltarno Paveltarno merged commit 3c22a50 into main Feb 12, 2026
20 checks passed
@Paveltarno Paveltarno deleted the setup-knip branch February 12, 2026 12:02
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.

1 participant