Using Knip in CI
Knip is your companion during local development. But it is even more valuable in a continuous integration (CI) environment to prevent regressions over time. Knip will notify you of unused dependencies, exports and files if you forgot to remove them.
Knip will exit the process with code 1
if there are one or more issues.
GitHub ActionsSection titled “GitHub Actions”
Here’s an example workflow configuration for GitHub Actions:
name: Lint project
on: push
jobs: lint: runs-on: ubuntu-latest name: Ubuntu/Node v20 steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - name: Install dependencies run: npm install --ignore-scripts - name: Run knip run: npm run knip
In CI environments, the —no-progress flag is set automatically.
Related featuresSection titled “Related features”
Related readingSection titled “Related reading”
ISC License © 2024 Lars Kappert