Frameworks

Next.js

App router, pages router, route handlers, all covered.

What's auto-detected

  • app/**/page.{ts,tsx,js,jsx}
  • app/**/layout.{ts,tsx,js,jsx}
  • app/**/loading.*, app/**/error.*, app/**/not-found.*
  • app/**/template.*, app/**/default.*
  • app/**/route.{ts,js} (route handlers)
  • pages/**/*
  • middleware.{ts,js}
  • instrumentation.{ts,js}
  • next.config.{ts,js,mjs}
Before vs afterBefore reachability-based detection, every page.tsx appeared as "dead code" because Next.js routes are loaded by the router, not imported. Now they're correctly recognized as entry points.

Server Actions

Server actions marked with 'use server' are treated as exports, if they're imported by a page or component, the call edge appears in the graph and the file stays reachable.

Edge cases

  • Parallel routes (@slot), supported via the app/** wildcard
  • Intercepted routes ((.), (..)), same
  • Dynamic segments ([slug], [...slug]), supported

Sample output

bash
larkx deadcode

Detected frameworks: next

Dead code (unreachable from entry points):
  Files (1):
    src/components/UnusedFooter.tsx

Note: the Next.js page tree is excluded from "dead code" thanks to framework detection.