mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-04-15 00:57:55 +00:00
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>
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
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;
|