Compare commits

...

2 Commits

Author SHA1 Message Date
Pablo F.G
bb77ec150b docs(ui): add changelog entry for knip setup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 14:33:24 +02:00
Pablo F.G
ca64e88cd0 chore(ui): add knip for dead code detection
Install knip and create initial configuration tailored to the Next.js 16
project structure. Adds `lint:knip` and `lint:knip:fix` scripts to surface
unused files, dependencies, and exports.

Baseline: ~504 issues (37 unused files, 22 unused deps, 399 unused
exports, 37 unused types, 5 unused enum members, 2 unresolved imports,
1 duplicate export). These will be addressed in follow-up PRs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 14:06:44 +02:00
5 changed files with 634 additions and 0 deletions

View File

@@ -14,6 +14,10 @@ All notable changes to the **Prowler UI** are documented in this file.
- Resource events tool to Lighthouse AI [(#10412)](https://github.com/prowler-cloud/prowler/pull/10412)
- Vercel provider: connect Vercel teams via API token, scan deployments, domains, projects, and team settings [(#10191)](https://github.com/prowler-cloud/prowler/pull/10191)
### 🛠️ Maintenance
- Added knip for dead code detection with `lint:knip` and `lint:knip:fix` scripts [(#10654)](https://github.com/prowler-cloud/prowler/pull/10654)
### 🔄 Changed
- Attack Paths custom openCypher queries now use a code editor with syntax highlighting and line numbers [(#10445)](https://github.com/prowler-cloud/prowler/pull/10445)

View File

@@ -1031,6 +1031,14 @@
"strategy": "installed",
"generatedAt": "2026-01-29T16:42:27.795Z"
},
{
"section": "devDependencies",
"name": "knip",
"from": "6.3.1",
"to": "6.3.1",
"strategy": "installed",
"generatedAt": "2026-04-10T11:55:26.693Z"
},
{
"section": "devDependencies",
"name": "lint-staged",

38
ui/knip.config.ts Normal file
View File

@@ -0,0 +1,38 @@
import type { KnipConfig } from "knip";
const config: KnipConfig = {
entry: [
// Next.js app conventions (pages, layouts, errors, route handlers)
"app/**/page.{ts,tsx}",
"app/**/layout.{ts,tsx}",
"app/**/error.{ts,tsx}",
"app/**/route.ts",
// Auth.js configuration
"auth.config.ts",
// Sentry runtime configs (dynamically imported by instrumentation.ts)
"sentry/sentry.server.config.ts",
"sentry/sentry.edge.config.ts",
// Build/postinstall scripts
"scripts/*.js",
],
project: ["**/*.{ts,tsx,js,jsx}"],
ignoreDependencies: [
// Next.js image optimization — loaded at build time, no static import
"sharp",
// Sentry instrumentation hooks — loaded via require() by the runtime
"import-in-the-middle",
"require-in-the-middle",
// @heroui/react re-exports all sub-packages; imports like @heroui/skeleton
// resolve to transitive deps of @heroui/react, not direct dependencies
"@heroui/*",
],
ignoreExportsUsedInFile: {
interface: true,
type: true,
},
};
export default config;

View File

@@ -12,6 +12,8 @@
"healthcheck": "pnpm run typecheck && pnpm run lint:check",
"lint:check": "eslint .",
"lint:fix": "eslint . --fix",
"lint:knip": "knip",
"lint:knip:fix": "knip --fix",
"format:check": "./node_modules/.bin/prettier --check ./app",
"format:write": "./node_modules/.bin/prettier --config .prettierrc.json --write ./app",
"prepare": "husky",
@@ -158,6 +160,7 @@
"globals": "17.0.0",
"husky": "9.1.7",
"jsdom": "27.4.0",
"knip": "6.3.1",
"lint-staged": "15.5.2",
"postcss": "8.4.38",
"prettier": "3.6.2",

581
ui/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff