Skip to content

KNIP - Add knip CI workflow, config, and cleanup unused code#115

Open
Atama-Heitekava wants to merge 18 commits into
mainfrom
feature/add-new-knip-command-workflow-and-config
Open

KNIP - Add knip CI workflow, config, and cleanup unused code#115
Atama-Heitekava wants to merge 18 commits into
mainfrom
feature/add-new-knip-command-workflow-and-config

Conversation

@Atama-Heitekava

@Atama-Heitekava Atama-Heitekava commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Description

Introduce Knip to detect unused files, exports, and dependencies across the codebase. This adds a CI workflow that runs automatically on every PR and push to main, along with a local script to reproduce the CI behavior.

Changes

  • Add knip.config.ts with documented configuration (Vercel entry points, UI components, .astro files, production mode false positives)
  • Add pnpm knip and pnpm knip:production commands to package.json
  • Add scripts/knip-ci.sh to reproduce the CI workflow locally
  • Create .github/workflows/knip.yml running knip in classic and production mode
  • Remove unused dependencies (motion, eslint-plugin-sonarjs) and unused file src/lib/zod-utils.ts
  • Fix a few dead links in content
  • Change the daily-deployment runs-on value for a fix version (and not latest)

Usage

Run a local test (classic)

pnpm knip

Run a local test (production)

pnpm knip:production

Notes

  • --ignore-scripts is used on pnpm install in CI to avoid ERR_PNPM_IGNORED_BUILDS — native modules are not needed for knip's static analysis
  • --reporter compact ensures readable output in GitHub Actions logs instead of the default interactive reporter
    ignoreExportsUsedInFile is only enabled in production mode to avoid false positives on public exports

close #55

…e its command for local run, and config file

No correction include for the error return by those commands
Test the solution proposed by claude code
@Atama-Heitekava Atama-Heitekava self-assigned this Apr 15, 2026
@vercel

vercel Bot commented Apr 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bearstudio.fr Ready Ready Preview, Comment Apr 16, 2026 10:03am

Request Review

@yoannfleurydev yoannfleurydev self-requested a review April 15, 2026 08:13
@DecampsRenan DecampsRenan self-requested a review April 16, 2026 08:24
Comment thread .github/workflows/knip.yml Outdated
jobs:
classic:
name: Knip (classic)
runs-on: ubuntu-latest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

en CI en général tu veux fixer la version de l'image ;) ça permet de stabiliser le job
Prend la dernière version LTS

…o ubuntu-24.04

Add the missing change on the other workflow daily-deployment.yml
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.

✨ Add knip config file and CI to better check dead code and cleanup options

3 participants