Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/knip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Knip

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
knip:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24.x
- name: Set up PNPM
run: corepack enable
- run: pnpm install

- run: pnpm run knip
32 changes: 32 additions & 0 deletions knip.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { KnipConfig } from 'knip'

export default {
entry: ['eslint.config.mjs'],
// knip's Nuxt plugin doesn't support the Nuxt 4 app/ directory convention yet.
// Note: custom entry replaces (not merges with) the plugin defaults.
nuxt: {
entry: [
'app/app.vue',
'app/error.vue',
'app/pages/**/*.vue',
'app/components/**/*.vue',
'app/composables/**/*.ts',
'app/utils/**/*.ts',
'app/layouts/**/*.vue',
'app/middleware/**/*.ts',
'server/api/**/*.ts',
'server/routes/**/*.ts',
'server/middleware/**/*.ts',
'server/plugins/**/*.ts',
'server/**/*.ts',
Copy link

Choose a reason for hiding this comment

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

Redundant server entry patterns subsumed by catch-all

Low Severity

The four specific server globs (server/api/**/*.ts, server/routes/**/*.ts, server/middleware/**/*.ts, server/plugins/**/*.ts) are completely redundant because server/**/*.ts on line 21 already matches every .ts file under server/, including all files those patterns would match. The specific patterns add no filtering value and only create maintenance overhead.

Fix in Cursor Fix in Web

],
config: ['nuxt.config.ts'],
},
ignoreDependencies: [
'vue',
'vue-router',
'vue-tsc',
'vitest-environment-nuxt',
],
ignoreBinaries: ['eslint'],
} satisfies KnipConfig
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"test:unit": "vitest run",
"knip": "knip",
"test": "pnpm run typecheck && pnpm run lint && pnpm run test:unit",
"typecheck": "nuxi typecheck"
},
Expand All @@ -32,6 +33,7 @@
"@nuxt/test-utils": "^4.0.0",
"@vue/test-utils": "^2.4.6",
"happy-dom": "^20.6.2",
"knip": "^5.83.1",
"typescript": "^5.6.2",
"vitest": "^4.0.18",
"vue-tsc": "^3.2.4"
Expand Down
Loading