npm / knip
knip
What changed in knip 5 to 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
25 breaking1 security113 new APIs and options9 performance114 behavior and defaults131 tooling337 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initknip 6476 changes
Breaking changes 18
Removes expo-router entry points from the Expo plugin.
Compiler import detection now requires a word boundary around the import keyword.
Knip now exits with code 2 when a plugin config file fails to load.
Knip now throws when configuration is not an object.
tsc is no longer included in ignoreBinaries.
Inline dynamic import loaders now consume only the default export.
Async glob no longer follows symbolic links.
Unused re-exports are reported when ignoreExportsUsedInFile is enabled.
Knip now assumes Node 24+ or Bun as its runtime.
ignoreBinaries was removed for tar-related behavior, so configurations relying on it may no longer have an effect.
The old experimentalTags configuration has been removed.
The classMembers issue type is no longer supported.
The experimental flag was removed; use --tags instead.
The JSON reporter no longer includes a root files property.
The flag was removed because including libraries is now the default and only behavior.
The flag was removed because isolated workspaces are now the default and only behavior.
The private issues._files property was removed from reporter function inputs.
Knip v6 requires Node.js 20.19.0 or newer.
Security 1
Argument arrays are encoded before shell-command parsing to preserve argument boundaries.
New APIs and options 73
Separates Expo Router support into its own plugin.
Supports function-based configurations in the Rsbuild plugin.
Uses files from TypeScript configuration references when enabled.
An osls plugin was added for analyzing osls projects.
Cucumber plugin handling now includes profiles, formatters, and require paths.
Adds a Railway plugin for Knip projects.
The ESLint plugin now supports import-x/* settings.
Adds support for oxlint extends configuration.
Added n8n to the supported projects.
Valueless Node CLI flags are now added to boolean options.
Added Varlock plugin support.
Diagnostics support an editor severity setting.
Knip supports configuring preprocessors in knip.json.
Adds support for glob from node:fs/promises.
defineConfig is now exposed through the ./config entrypoint for configuration authoring.
oxlint and vite-plus import resolvers can now be resolved from settings.
Knip now supports TypeScript content mappers for processing TypeScript content.
Knip now supports the oxfmt.config.mts configuration file.
Knip now supports the oxlint.config.mts configuration file.
Adds a Borp plugin for detecting usage in Borp projects.
A SARIF reporter is now available for producing SARIF-formatted results.
The Stryker integration now supports TypeScript extensions.
Convex function modules are now discovered automatically.
Vitest inline project configuration extensions are now supported.
The react-email dir argument now accepts the -d alias.
The tanstack-router plugin now supports TanStack Start.
Adds a plugin that recognizes electron-vite conventions.
Reads oxlint jsPlugins from vite-plus vite.config and .oxlintrc.json.
Adds a plugin that recognizes Laravel conventions.
Adds support for the @nuxtjs/i18n plugin.
Recognizes vite-plugin-vue-meta-layouts using the same layouts convention.
Supports @vite-pwa/nuxt PWA configuration in nuxt.config.
Circular dependencies can now be reported through the opt-in cycles issue type.
Knip adds an eve plugin for the Vercel framework.
The Next.js plugin now supports next.config.mts.
Knip now supports packageExtensions in Yarn and pnpm configurations.
Knip now supports Prettier overrides.
Script commands are now parsed with a parser built on unbash.
Exports the Issue type for consumers of Knip's type API.
Exports the IssueRecords type for consumers of Knip's type API.
Exports the IssueType type for consumers of Knip's type API.
The Starlight plugin adds customCss support for configuring custom CSS.
Knip adds support for nub.
Knip adds support for Lunaria.
Adds an opt-out for raw transfer behavior.
Knip supports a new optional SvelteKit configuration pattern through Vite config.
Adds a followCursor setting for the Imports and Exports views.
Supports configuring ignoreIssues separately for each workspace.
ignoreExportsUsedInFile can now be configured independently for each workspace.
Adds workspaceRoot so the VSCode extension can work when the workspace root lacks package.json.
Adds a command-line option to disable tag hints.
Adds treatTagHintsAsErrors to configure tag hints as errors.
Adds -D as a CLI argument shorthand.
Adds a zero-overhead duration measurement option.
Adds -f as a CLI argument shorthand.
Adds -F as a CLI argument shorthand.
Adds -p as a CLI argument shorthand.
Adds -s as a CLI argument shorthand.
Adds -u as a CLI argument shorthand.
Adds -w as a CLI argument shorthand.
Knip now recognizes Jest configuration files using the .cts and .mts extensions.
Some Knip plugins now recognize configuration files with .mts and .cts extensions.
Mercurial is now included in command constants.
Source-map subpath imports are supported.
A Vercel configuration plugin was added for detecting or handling Vercel configuration.
compiler-extensions are supported in tsc-files mode.
Plugins can contribute source-map rules, allowing integrations to extend source-map handling.
The knip-run tool now supports a workspace option for selecting the workspace to run.
The pino plugin adds a transportCall visitor for analyzing transport calls.
Adds a Rolldown plugin to Knip.
The KnipConfiguration type is now exported for dynamic configuration use cases.
Adds a setting for specifying the Node.js runtime path used by Knip.
Replaces convertPathsToAlias as the path-mapping function.
Performance 3
Performance was improved slightly, which may make Knip runs marginally faster.
Glob results are cached across runs using the --cache option, improving repeated analysis performance.
The module graph queue is deduplicated to avoid processing the same files redundantly.
Behavior and default changes 68
Applies a directory’s .gitignore before walking its subdirectories.
Test files are excluded from package entries when production mode is enabled.
The MDX content mapper now resolves remarkPlugins configuration.
NODE_OPTIONS inputs are now applied to package manager binaries.
Typedoc plugin options now accept the string form.
Typedoc theme options now accept the string form.
Source is compiled on demand.
The content mapper process is now resolved from the package.json TypeScript content mapper exec setting.
printf is now ignored as a global binary.
Referenced config files are handled in their own plugin, affecting how Knip processes project configuration.
Built-ins are classified from module specifiers.
Entries are now resolved from Mocha script arguments.
Catalog references are tracked across scoped runs.
Object jsPlugin specifiers are now read from Vite+ configuration.
Catalog references in pnpm dlx scripts are now tracked.
Published type dependencies are now analyzed.
Script catalog references are tracked across scoped runs.
Assets referenced from SCSS URLs are now tracked.
Unresolved catalog references are now reported.
Scoped runs now include workspace dependencies.
Common global binaries are ignored during dependency analysis.
Common system binaries are ignored during dependency analysis.
The glob cache now records all traversed directories.
Types referenced through JSDoc imports are now tracked during analysis.
Multiple preprocessors can now run sequentially.
bun script references now expand forwarded arguments.
Knip recognizes an expanded set of global binaries.
npm script references now expand forwarded arguments.
Script tokens shaped like paths are now treated as file references.
yarn script references now expand forwarded arguments.
The gh binary is treated as globally available.
Gitignored package entry points are excluded from analysis.
More globally available binaries are ignored during unused-binary analysis.
Plugin entries are read from index.html.
Oclif command files are now registered as entry points.
Plugin entries are read from vite.config options.
GraphQL Code Generator outputs are now treated as entry points.
import.meta.glob analysis now resolves path aliases.
require.context analysis now supports rspack and path aliases.
Shell command scripts now handle variable interpolations during analysis.
The execa visitor now detects scripts invoked with execaNode.
Optional peer dependencies referenced only via a host are now skipped.
npx-run binaries are marked optional unless --no-install is used.
Stale workspaces configuration keys are reported as configuration hints.
Module paths are resolved from the selected tsconfig.
Scoped and tilde SCSS imports are treated as packages during analysis.
Custom path aliases are now scoped independently per workspace.
The dependencies key is now linked with notes, improving how dependency findings are explained.
The --trace functionality has been overhauled and improved.
The Docusaurus integration now ignores paths matching @generated/*.
The Nx integration now expands projectRoot and workspaceRoot token variables.
Comments are stripped from scripts processed by compilers.
Wildcard patterns in Jest projects are now expanded.
Pairs are collected from referenced TypeScript configuration files.
The title of direct configuration hints is now written to stderr.
Cypress reporter configuration is now resolved separately for each testing type.
In knownBinsOnly mode, fallback binaries inferred from plugin names are now optional.
Shell binaries are now included in the global ignore list, reducing false-positive reports for commonly available commands.
Imports in declaration files are treated as type-only.
Types listed in tsconfig compilerOptions.types are treated as type-only.
Error and warning logs now use a consistent prefix.
Knip now inherits outDir and rootDir from referenced tsconfig projects.
SCSS path aliases can now be resolved during analysis.
Knip now supports scoped package names prefixed with a tilde, such as @~private/pkg.
The Metro plugin is enabled when Expo is installed.
Issues are initially suppressed in the MCP server to avoid overwhelming the agent.
JSDoc tags are merged across function overload signatures, affecting how Knip interprets overloaded functions.
Trace output now includes namespace member statuses, making namespace analysis results more visible.
Tooling 83
Adds Flue plugin support for projects using Flue.
A Jasmine plugin was added for analyzing Jasmine projects.
Improves Knip support for Rstest projects.
Adds a plugin for analyzing Turborepo projects.
Unused member tags are now flagged in tagged enums and namespaces.
Export analysis now shows ambiguous, shadowed and converged exports.
Traces now explain ambiguous star exports.
Added babel to the supported projects.
Added khan to the supported projects.
Added oxc to the supported projects.
Added support for the Tailwind webpack plugin as a plugin enabler.
Added the textlint plugin.
Knip adds a mise plugin.
Package manifests can now be resolved under Yarn Plug’n’Play environments.
Adds a pre-commit plugin for detecting usage in pre-commit configurations.
Adds a tsd plugin for detecting usage in tsd projects.
Adds basic support for Marko 6 and 5, allowing Knip to analyze projects using those versions.
Adds a built-in compiler for tsrx.
Angular global stylesheets are now discovered from angular.json.
Projects receive a hint when patterns exclude a compiled extension.
Adds support for discovering markdownlint-cli2 usage.
Adds an OpenClaw plugin for project analysis.
Tailwind CLI input stylesheets are now discovered.
tsdown CLI entry points are now discovered automatically.
Tailwind CSS URL imports are now supported.
Knip adds a Temporal plugin for analyzing Temporal usage.
TypeScript 5.0 narrowing for ssr.external is supported.
The Vitest plugin now handles snapshotSerializers.
Vue 2 template auto-imports are now supported.
Babel plugins are detected in the Storybook configuration.
Adds a plugin that recognizes esbuild conventions.
Adds support for the @intlify/unplugin-vue-i18n plugin.
Adds a plugin that recognizes Quasar conventions.
Adds a plugin that recognizes Tauri conventions.
Adds support for the unplugin-icons plugin.
Adds support for the vite-plugin-pages plugin.
Adds support for the vite-plugin-pwa plugin.
Adds vite-plus support for run.tasks and staged scripts.
Adds support for the @vite-pwa/assets-generator plugin.
Adds plugins supporting the Vue auto-import ecosystem.
Enables Vue SFC compiler support for unplugin-vue and @vitejs/plugin-vue.
TypeDoc customCss files are now resolved by Knip.
TypeDoc customJs files are now resolved by Knip.
Knip adds a Fumadocs plugin for framework-specific analysis.
The Storybook plugin now registers the MDX compiler for analysis.
Knip now detects the Node.js test runner through the script command parser.
Adds Astro import resolution.
Adds Less compiler support.
The Stencil plugin now handles SCSS.
Adds Stylus compiler support.
Adds Svelte import resolution.
Adds Vue import resolution.
Knip adds support for the @astrojs/markdoc integration.
Knip now supports XO v1 and later.
Knip now detects dependencies used by Vite configuration files.
Updates Jest entry patterns for Jest 30.
Adds tar to the globally ignored binaries list.
Published workspaces now flag undeclared imports from sibling packages.
Adds Catalyst plugin support for crediting bare @controller custom elements.
Knip detects and credits registered custom elements, including aliases, scoped registries, and static blocks.
Adds FAST plugin support for detecting @customElement classes and scopes static custom-element detection to FAST.
Adds Lit plugin support for detecting classes decorated with @customElement.
Knip now detects binaries and entry files referenced in node:child_process calls.
Improves Stencil detection by crediting @Component and recognizing test files.
Adds a nano-spawn plugin for analyzing projects that use nano-spawn.
Adds an Orval plugin so Knip can account for Orval-generated usage.
Knip now detects Babel plugins and presets configured in Vite plugin options.
Knip detects dynamic import attributes using an import matcher shared with Astro-MDX.
Knip can scan source files for Knex configuration.
Types are now exposed for the JSON reporter, enabling developers to use its type definitions.
Added support for new pnpm 11 commands and additional pnpm commands.
Added a WXT plugin for Knip.
Adds handling for Vitest agent configuration.
The react-email plugin was updated to support react-email version 6.
A plugin for @sveltejs/package was added, improving Knip support for projects using that package.
Knip now extracts vite.resolve.alias from Astro configuration AST, improving analysis of aliased imports.
Knip adds a plugin for react-email, enabling its usage to be analyzed.
Knip adds a plugin for the Serverless framework, enabling Serverless projects to be analyzed.
Knip reports hints for redundant or unregistered extensions in configuration.
Knip adds support for analyzing Panda CSS projects through a dedicated plugin.
Tailwind CSS compiler support is enabled for @tailwindcss integrations.
React Router routes can now use absolute file paths, allowing Knip to analyze those route references.
Adds a Stencil plugin to Knip.
Fixes and other changes 230
Applies nested .gitignore files when resolving workspace globs.
Keeps the current working directory out of glob patterns and matchers.
Recognizes binaries supplied by optional dependencies that are absent.
Recognizes all React Native configuration file extensions.
The TypeScript integration fixes handling for ArrayExpression.
The Capacitor plugin now matches capacitor.config.js.
The plugin now resolves local and scope-only extends configurations.
Commitlint plugin names now include the commitlint-plugin prefix.
Source path mapping now includes custom compiler extensions.
The Serverless Framework integration now handles explicit extensions in handler paths.
Jest module names without the jest-* prefix are now resolved.
Source path mapping now includes the jsx extension.
The simple-git-hooks plugin now matches .mjs configuration files.
Locally referenced namespace members are preserved during analysis.
The oxlint integration now resolves lint configuration from the loaded Vite config.
Null package exports are resolved to the files they hide.
Disabled plugins in PostCSS object configurations are now ignored.
Self-closing script elements no longer swallow the next script element.
Serverless file variables are now resolved in plugins and functions.
The rsbuild integration now detects configuration from tools.rspack inside rsbuild config.
Vitest paths are now resolved from the top-level root.
The Playwright plugin now resolves webServer commands.
Workspace exports with fallback arrays are now resolved.
Angular preserves other projects' inputs when one project has no architect.
Excluded tags on entry re-exports are now handled correctly.
Entry export tags are read under the names used by re-exports.
Playwright resolves globalSetup from the configuration directory.
Playwright resolves globalTeardown from the configuration directory.
Vite resolves nested HTML entry points in multi-page applications.
Nuxt auto-import compilation skips synthetic self-imports.
Vue auto-import compilation skips synthetic self-imports.
Fixes the plop plugin mapping from config to entry.
Fixes import.meta handling in built-in compilers.
The MDX content mapper now resolves providerImportSource.
Mocha configuration files now resolve the file option correctly.
Fixes tag hints for enum and namespace members.
Binary matching now considers only the actual dependency providers, improving detection accuracy.
The ESLint plugin now resolves --format names correctly.
Executable references are preserved across package manager commands, preventing them from being lost during analysis.
The config loader now enables JSX, allowing JSX syntax in Knip configuration.
Near-operation-file outputs are treated as entries rather than the documents directory, improving Knip's GraphQL Code Generator analysis.
npx no-install flags are respected when they appear before the executable.
Knip now recovers from corrupt cache files.
Dependency removal no longer leaves an incorrect trailing comma.
Eslintrc configurations now resolve local extends files.
The ESLint plugin now handles the array form of the import/resolver setting.
Fixed the language server's bundled Knip fallback.
Shared info/exclude handling now works correctly in linked Git worktrees.
The ESLint plugin now handles eslintrc parserOptions.parser correctly.
Re-export traces now resolve to their defining bindings.
Fixed loader dependency handling for Next.js Turbopack projects.
Vitest setupFiles are now resolved correctly from nested configs.
Fixed npm alias attribution under Yarn PnP, improving dependency attribution in that environment.
Knip honors explicit entry export analysis.
Knip falls back to searching for the lock file at cwd when it is missing at root.
Knip no longer flags a tag that suppresses member issues.
Knip resolves Nuxt Virtual Component Imports.
Knip recognizes pnpm stage as a built-in.
Knip tracks pnpm workspace override catalogs and reads pnpm.overrides from the root manifest.
Knip ignores raw Vite import globs.
Knip now tracks spreads under string-literal keys.
Knip supports object-form Rstest test environments.
Knip resolves Vite public script entries.
Validates numeric CLI options instead of passing NaN through.
Reports types used only in private parameters correctly.
Resolves Nuxt #shared imports from the shared directory.
Respects JSDoc tags on URL dependencies.
Compiles files with workspace-scoped compilers.
Enum element access is now counted as a whole-object read, improving unused-code analysis.
exec.ts now preserves all environment variables when executing commands.
Named string-key access on namespace-qualified enums is now resolved correctly.
Element access remains precise for enum member names that resemble numbers.
Nuxt layer sources are now resolved from all extends entry shapes, including string extends configs.
Object enum enumeration is now resolved through import aliases.
Knip now resolves oxlint JavaScript plugins declared in the oxlint configuration file.
Unused exports behind Vitest module promise mocks are now reported correctly.
Webpack entry descriptors are now resolved using the import field.
The bun 1.4 dedupe subcommand is now recognized.
Nested gitignore negation inside ignored dot-directories is handled correctly.
All supported lefthook configuration file names and extensions are now matched.
Missing pnpm subcommands are now resolved correctly.
Vitest include patterns are resolved relative to test.dir.
Configuration files using .cts and .mts extensions are now matched.
Vitest mocks are now resolved from the test root.
Local Vitest reporters are now resolved from the test root.
All supported WebdriverIO configuration file extensions are now matched.
Supported lint-staged configurations are fixed so Knip recognizes them correctly.
Absolute-path script tokens are no longer treated as entries.
babel-jest configFile is resolved from Jest transform options.
The Node test runner is detected when invoked through c8.
Playwright config files with .cjs, .cts, and .mts extensions are now matched.
Rollup's --config argument is resolved as plugin configuration.
Script words retain quoting while passing through resolvers.
The VS Code language server process is restarted to resolve an issue.
Wildcard subpath-import aliases are now attributed as dependency usage.
Remark now supports all types of dependency names.
Dynamic imports in Svelte component templates are now detected.
Fixes the -u shortcut for the --duration option.
Entry-exported members remain public, preventing them from being reported as unused.
Composite GitHub Actions now resolve $GITHUB_ACTION_PATH correctly.
Nested files under a gitignore dir/* pattern are now ignored correctly.
Unrelated gitignore negations no longer un-ignore sibling paths.
The glob cache is invalidated when .gitignore changes.
Built-in node: specifiers are no longer reported as unlisted dependencies.
Nuxt and Nitro plugin resolution is improved.
Nuxt module paths are resolved correctly.
The [-]-c[heck] option is no longer incorrectly treated as a Prettier config flag.
Imports of aliased packages are attributed to the declared dependency.
Ambient module declarations in script files are no longer counted as imports.
Local binaries invoked through bun run are now resolved.
Unresolved imports of gitignored generated files are skipped.
Package names are resolved correctly from aliased node_modules paths.
pnpm script references now expand forwarded arguments.
Imports inside block comments are ignored during stylesheet analysis.
Unresolvable imports of transitive peer dependencies are flagged as unlisted.
Dependencies listed in tsdown neverBundle are marked as referenced.
Dependencies in vite ssr.external are marked as referenced.
Unbuilt workspace package exports can now be resolved.
Ambient declaration files are no longer reported as unused.
Auto-imported components are resolved in the Vue SFC compiler.
Hash imports resolve to source when the node condition points to an unbuilt target.
Nitro route types are no longer misread as Vue component auto-imports.
Optional peers in pnpm and Yarn packageExtensions are respected.
Vitest benchmark files are resolved as entry points.
Bun test entries are only enabled when an actual bun test invocation is detected.
Jest transform analysis now resolves inline Babel presets and plugins.
Types used in module augmentations are now found through path aliases.
Package names are now derived correctly from package.json in Yarn pnpm linker stores.
Serverless esbuild inject entries are now resolved.
Next.js src/ entry patterns are resolved like Next.js, improving file detection.
Inherited tsconfig paths are resolved relative to the extended config directory.
Built-in compiler dependencies are no longer reported as unused.
import() used in JSDoc examples is ignored during analysis.
Reporters now always print the issue-type title when a group contains a single issue.
Types used only in module augmentations are no longer reported as unused.
Scripts in the working directory are no longer reported as unlisted binaries.
Dependencies in dedupe are no longer reported as unlisted.
Dependencies in optimizeDeps are no longer reported as unlisted.
Vite and Vitest plugins are enabled when vite-plus is found.
Detects Next.js entry files located in subdirectories.
Prevents a crash when the package root export is null.
Resolves subpath imports that use a colon prefix.
Fixes cycles in cached plugin configuration.
tsconfig paths are resolved for non-TS importers independently of oxc ownership.
Fixes false positives reported for Vitest mocks.
Configuration hints remain enabled during workspace-scoped runs.
Fixed the Jest plugin behavior for projects using Jest with Knip.
Knip now detects react-email packages when their version ranges are non-numeric.
Knip now detects the coverage provider when Vitest is invoked with the bare --coverage flag.
Workspace discovery now includes workspaces appearing after a negated pattern.
Fixes repeated use of the --fix-type argument.
Improves iOS platform detection when using Swift Package Manager with Capacitor.
Knip now resolves SvelteKit ./$types correctly in monorepos.
Fixes crashes and parsing problems caused by backtick string literals in plugin configuration.
Knip now reports an exported type used only in an inferred-return function body.
Vite analysis now detects inline module script entry points in index.html.
Failed plugin configuration loads are no longer cached, allowing later retries.
Extensionless .sass imports are now resolved in the SCSS compiler.
Plugin configuration loading now resolves tsconfig paths correctly.
Binary dependencies used by Bun are now tracked correctly.
Type dependencies from extended tsconfig files are now attributed correctly.
The Astro plugin now supports both possible middleware entry points, improving dependency analysis for Astro projects.
GraphQL Codegen script configuration dependencies are now attributed correctly.
Dependencies used by the Serverless TypeScript plugin are now handled correctly.
Knip detects dynamic imports in the Svelte compiler.
Undeclared imports between sibling workspaces are no longer flagged as unlisted.
Imports satisfied through transitive peer dependencies are now resolved.
Knip correctly handles re-exported namespaces using the export * as syntax.
Package exports are handled correctly when outDir is set to the project root.
The star re-exported namespace case is handled correctly.
Symbol reporter file paths are corrected when using --directory.
The serverless-framework integration skips functions that do not define a handler.
Webpack now references TS loaders for .ts and .cts configuration files.
Knip now correctly handles inferred declaration export references.
Knip now correctly handles type-only imports in monorepos.
Knip now correctly detects Vercel configuration.
Knip now detects babel.plugins in @vitejs/plugin-react when defineConfig uses function form.
Knip now detects babel.presets in @vitejs/plugin-react when defineConfig uses function form.
A declaration export regression was fixed, restoring expected declaration export behavior.
The --no-exit-code condition now works correctly when configuration hints are treated as errors.
SFC script attribute values may now contain > characters without breaking detection.
PostCSS detection now correctly handles @tailwindcss/postcss.
Knip flags stale @internal tags when running in production mode.
Imports matching engines.X are no longer reported as unlisted.
Hoisted dependencies are resolved from the monorepo root when using single-package mode.
Packages are no longer incorrectly reported as unlisted when only their corresponding @types package is listed.
Fixed handling of spread exports so other exports are used correctly.
A config file load error no longer causes the process to exit.
Workspaces with invalid JSON manifests are skipped instead of preventing processing.
Fixes markdown reporter column width for more consistent generated output.
Adds handling for minimal reporter configurations.
Package manifests with a leading UTF-8 BOM are parsed successfully.
Out-of-bound writes to stdout and stderr are preserved.
Type-chain alignment was tightened and gated through ignoreExportsUsedInFile.
Output is flushed when the process exits, helping ensure complete results are emitted.
Props are treated as used when Astro.props is referenced.
Knip no longer tracks typeof value references at the top of exported type aliases.
Entry points are now resolved from the rslib configuration.
The package-entry hint for a bare specifier in main was fixed.
The Prettier plugin now accepts arguments needed to resolve the --config CLI flag.
Root directory discovery now tolerates JSONC and array-based extends configurations.
Bun plugin now handles file path arguments.
Jest environment pragmas resolve correctly and apply only within their intended scope.
Namespace members enumerated through Object APIs are treated as used, avoiding incorrect enum-member checks in nsTypes mode.
Namespace members are marked used when enumerated through Object APIs.
Worker and child_process calls now resolve paths constructed with path.join(__dirname, ...).
Rspack plugin detection now recognizes plugins provided through swc-loader.
Namespace imports used as object property values are now tracked, improving Knip's unused-code analysis.
Peer dependency resolution is fixed, improving dependency installation and compatibility for Knip users.
Improves Knip's handling of module.register usage during analysis.
Vitest coverage dependencies are marked optional when addon-vitest is used, improving dependency analysis for Storybook projects.
The regex now allows extra attributes in reference types directives.
Absolute Vitest test roots are now handled correctly.
Fixes an edge case involving the filePath config hint.
The oxlint plugin supports jsPlugins and resolves their dependencies.
Astro sharp detection now matches the default behavior.
Fixes false-positive unused dependency reports when Knip runs from a workspace directory.
Nx run-commands targets without a cwd now fall back to the workspace cwd.
Namespace member references are resolved in a post-walk batch pass, improving reference resolution.
Adds shadow detection for function parameters, arrow parameters, and catch bindings.
Trailing slashes are stripped from tsconfig outDir and rootDir values, preventing path resolution issues.
Trailing slashes are stripped from tsconfig outDir and rootDir values, preventing path resolution issues.
Empty strings are filtered from Qwik routesDir values.
Symlinks from tsconfig files are handled as real paths.
Knip now passes rootDirs through to work around a resolver feature gap.
Shadow detection is now scope-aware, fixing false negatives caused by name-based matching.
Type reference collection no longer causes false negatives from overly broad analysis.
Local refs visitor now handles computed access, improving analysis of local references.
JSON reporter issues are now consistently represented as arrays for every issue type.
Reporter functions now use issues.files consistently with other issue shapes.
knip 5254 changes
Breaking changes 7
Knip no longer reports unused files outside the project set.
Known binaries are accepted only after a double-dash separator.
The Tailwind plugin no longer recognizes the @source matcher.
ignoreExportsUsedInFile is no longer included in the default configuration.
Options after help or version are now read, affecting how command-line arguments are interpreted.
globalSetup is now resolved from the config file directory.
setupFiles is now resolved from the config file directory.
New APIs and options 40
Oxfmt configuration files written in TypeScript are now supported.
The oxlint plugin recognizes oxlint.config.ts files.
The Nuxt plugin now supports extends configuration.
Treats package.json#imports entries as project entry points.
The language server reads initializationOptions.config or falls back to a default configuration object.
A flag now controls filtering of transitive dependencies.
A pm2 plugin is now available.
serverInfo now includes the LS version.
A new SvelteKit plugin was created, split from the existing Svelte plugin.
isDirectory now accepts cwdOrPath as an input.
isFile now accepts cwdOrPath as an input.
Missing Bun commands and aliases were added.
Git worktrees are now supported.
Webpack plugin configuration now supports subpath entries.
WorkspaceConfig is now exposed for developers to use in integrations or tooling.
Adds dependency usage on hover to the language server and extension.
Adds the getDependencyUsage operation to the explorer.
Adds and uses imports.externalRefs for dependency analysis.
Adds a dependency tracing flag and trace reporter.
Adds the configFilePath setting for specifying the configuration file path.
Adds an MCP server for integrating Knip with MCP-compatible tools and agents.
Adds a flag allowing project files to use TypeScript compiler file resolution.
Adds a dedicated next-mdx plugin extracted from the next plugin.
Adds the extensionAlias configuration option.
The refs tracker now supports and improves importAliases handling.
Adds support for compiling SASS and SCSS files.
Adds tsconfig: auto support and uses the resolveFileSync method.
The Vite plugin now supports CLI arguments for the config file.
The Storybook plugin now supports viteConfigPath.
A graph explorer is introduced for inspecting the project graph.
Adds a Taskfile plugin for analyzing Taskfile-related project usage.
The ESLint plugin now supports the --format option.
URL constructors using import.meta.url are now supported.
Adds ignoreMembers to the workspace schema, allowing developers to configure ignored workspace members.
Adds an astro-db plugin with configuration support.
Adds a command-line argument to limit how many issues are shown.
Experimental support was added for Next.js conventions.
Knip recognizes proxy.ts as an entry file for Next.js projects.
Additional Vitest built-in reporters are supported in configuration.
Issue types can be ignored per file pattern, with ignoreIssues added to the JSON Schema.
Performance 6
Improved Docusaurus analysis speed.
The --performance output is improved and timerify calls are cleaned up.
Improves performance when running Bun commands.
OG image generation now uses a cache to speed up build time.
The workspaces finder is optimized, improving Knip's workspace discovery performance.
JSON loading was sped up, reducing time spent processing configuration or project data.
Behavior and default changes 46
Nuxt extends entries are now treated as dependencies during analysis.
Knip identifies binaries invoked through find -exec.
Knip skips optional peer dependency issues for installed dependencies.
Nx run-commands are resolved from their cwd.
Compiled files are no longer modified by automatic fixes.
Adds .git to the global ignore patterns.
Includes additional entry patterns when pageExtensions is configured.
The TypeScript plugin now adds aliases from any tsconfig file.
Some Next plugin glob patterns are merged, changing how matching paths are grouped.
Positional arguments passed to bun test are treated as entry points.
date is now treated as an ignored global binary.
The React Native plugin ignores RNC CLI and Metro internals.
The language server uses --stdio when no transport is provided.
Long file paths are truncated from the left side.
Path-like specifiers are no longer highlighted in output.
The init script warns when it detects a faux monorepo.
The workspace filter behavior was expanded.
The CLI now shows a link to documentation when module load errors occur.
The OG image cache directory was moved, potentially allowing Cloudflare build cache reuse.
Deferred entries now accept node_modules/ specifiers.
Negated ignore patterns can now filter issues.
Moonrepo command configuration now accepts arrays.
Source mapping is loosened to improve issue detection.
Error logging was improved, making failures easier to diagnose.
The configuration defaults to the packageManager specified in package.json when present.
Tool results now include enabled plugins and avoid unnecessary entries.
Adds op to the endOfCommandBinaries configuration setting.
The sourceMap setting was reverted, so developers should no longer rely on this configuration change.
Sessions without a configuration file now enable TypeScript compiler file handling.
Class member tracking was improved, which can affect Knip's unused-code analysis.
resolveSync now supports JSON and JSONC files during module resolution.
The resolver now supports DTS extensions, improving resolution of TypeScript declaration files.
clear is now treated as an ignored global binary.
Dependencies used by IDE extensions are now ignored.
Non-package specifiers are made relative in the SCSS compiler.
The performance-fn CLI option now accepts multiple values.
MDX plugins defined in the Next.js configuration are now discovered.
sed is now globally ignored as a binary during analysis.
Function calls executed in subshells are filtered out during analysis.
The catalog issue type is now auto-fixable.
Trace output now prints relative paths.
Binary validation now checks only the first word.
Entry paths from package.json now receive a label.
Entries in rsbuild config are treated as production entries.
defineNuxtConfig is now writable and deletable, allowing developers to modify or remove its properties.
Watch mode now clears the screen during operation.
Tooling 48
Added a patch for Argos integration support.
Knip now detects duplicated dependencies declared in package.json.
Added a Raycast plugin, enabling Knip support for Raycast projects.
Added a Sanity plugin, enabling Knip support for Sanity projects.
The --memory output is improved and timerify calls are cleaned up.
Knip adds an oxfmt plugin for analyzing oxfmt usage.
Knip recognizes pkg as a built-in pnpm command.
Adds support for Nuxt auto-imports.
Adds support for analyzing openapi-ts projects with Knip.
Adds support for analyzing Qwik projects with Knip.
Knip adds a plugin for Payload CMS projects.
The Bun test plugin now supports preloaded files.
The Convex plugin now supports nested _generated directories.
Knip adds configuration hints for unused ignore entries when they are relevant.
Knip adds configuration hints for unused ignoreFiles entries when they are relevant.
A language-server binary is now available.
Knip recognizes module.register() usage from the Node.js loader API.
The plugins now support the TypeScript native preview compiler.
The Vite integration detects a module entry from index.html.
Knip adds support for monorepos when installing dependencies.
Vitest argument handling is improved and extended.
Knip adds a plugin for expressive-code projects.
Knip now detects and installs packages that are not installed.
A Nitro plugin was added for project analysis.
SvelteKit entry files are now included in analysis.
Adds the astro-og-canvas plugin to Knip.
NX plugin support was extended.
TanStack Router configuration support was improved.
Adds a plugin for Parcel, enabling Knip integration with Parcel projects.
Knip added a Knex plugin for analyzing Knex usage.
Knip added a TanStack Router plugin.
Astro compiler support is improved.
Configuration patterns are moved to entries.
Configuration hints for redundant entry patterns are improved, helping developers identify unnecessary patterns.
Adds a VitePress plugin integration so Knip can support VitePress projects.
Adds a language server for editor-based interaction with Knip.
Adds a VS Code extension for using Knip from the editor.
An SWC plugin was added, enabling Knip to integrate with SWC-based projects.
Adds a next-intl plugin so Knip can recognize its usage.
Adds the SVGR plugin.
Adds support for analyzing the promise returned by an awaited import call.
Adds a Prisma plugin entry and Prisma schema compiler for analyzing Prisma projects.
The Prisma plugin was extended with additional support.
Adds support for CSpell TypeScript configurations, allowing Knip to work with those configuration files.
Adds an mdxlint plugin for Knip integration with mdxlint.
The create package now includes a knip.json configuration file.
Adds support for the Tailwind CSS compiler.
A Danger plugin was added for Knip.
Fixes and other changes 107
Fixed a regression affecting module and namespace resolution.
Fixed Docusaurus scripts and stylesheets handling.
Knip identifies @babel/runtime as needed when @babel/plugin-transform-runtime is used.
Dependency resolution for openapi-ts is corrected.
The changesets plugin detects local $schema references.
Prevents a false positive for unused sharp when using Astro sharpImageService().
The Bun plugin now handles directory arguments passed to bun test.
The SWC plugin now recognizes @swc/helpers when externalHelpers is enabled.
Fixed the exit code produced when using --fix.
Adds the built-in null reporter to Playwright plugin handling.
Import specifiers using .ts extensions are now fixed and linted.
Fixes tsconfig presets being treated as unlisted in strict mode.
The Vite plugin now respects root when discovering index.html entries.
Normalizes Windows backslash paths in watch events so --watch works correctly on Windows.
The Wrangler plugin is now enabled when configured through jsonc.
Detects Yarn plugins listed only by their filesystem path.
Knip now reports the correct coverage provider.
Knip is now compatible with the erasableSyntaxOnly TypeScript setting.
Memory exhaustion during gitignore traversal is fixed for large monorepos.
The Next plugin searches everywhere for manifest and robots files.
Regex matching is fixed for path-aware require.context patterns.
Compatibility issues with tsdown entry configuration are fixed.
False positives are fixed for arrow-wrapped dynamic imports assigned to variables.
module.register is ignored when its second argument is not import.meta.url.
Argument handling for pnpm is improved.
Knip adds handling for double-dash command-line arguments.
A type issue involving exported values is fixed.
Exports, including type-only uses, are no longer flagged when protected or consumed.
Vitest setupFiles resolution is fixed so configured setup files are handled correctly.
Unused file output in table format is corrected.
The compact reporter filters out empty issue objects.
Excluded issue types are no longer added to results.
Empty manifest entries are skipped.
Empty string entries in package.json exports are now skipped.
Configuration load errors now include a hint and example environment variable fixes.
All members of an enum are considered used when referenced through keyof typeof.
Manually enabled compilers are handled correctly.
Optional peer dependencies are excluded from the production dependency check in strict mode.
Knip no longer crashes when a Prisma schema path is not specified.
React Router appDir handling was improved.
The glob escaper was fixed.
The compiler now resolves _partial.scss files correctly.
Makes stderr redirection platform-agnostic so command behavior works consistently across platforms.
Knip only tries to use tsconfig files when tsconfig.json exists.
Gitignore ancestor detection was fixed for Git worktrees.
Recursion handling for namespaced self-re-exports was fixed.
Package manager detection was fixed for Yarn Berry projects.
TypeScript issues with function-based configuration are fixed.
Exported types used in exported interfaces are now considered used.
Fixes are now applied after preprocessors run.
GraphQL Code Generator plugin package mapping is improved.
The bunx handler was improved, resolving issue #1410.
Handling for bun and node test runners was improved, resolving issue #1411.
Bun script file resolution was improved, helping Knip analyze Bun scripts more accurately.
Script handling was improved, affecting how Knip processes project scripts.
Knip now walks through entry files, resolving issue #1397.
Fixed handling of glob-like entries and links in workspaces shown in the imports tree view.
Deduplicates dependency trace output.
Reduces excessive output and improves handling for files outside the project scope.
Fixes an unexpected error when pnpm catalogs are empty.
Restores support for the workspace:* protocol.
Improves the displayed import location when hovering an export.
Fixes path resolution in the exports tree view.
Fixes Knip support for Windows environments.
Sass builtin dependencies are now ignored in Sass and SCSS files, reducing false positives in dependency analysis.
The Bun resolver now detects publish and other builtin commands as builtins instead of unlisted binaries.
Namespace imports used as default values in destructuring are now detected correctly.
Issue types in the JSON schema were synchronized, keeping schema validation aligned with supported issue types.
Knip improves handling of bridged require calls in TypeScript modules.
Astro srcDir config detection no longer creates wrong entry patterns.
Fixes a regression affecting require calls in TypeScript files.
Resolution now bails out early when a specifier starts with a colon.
Tracing keeps exports and members through pseudo re-exports and conditions.
Handling of bindings from dynamic imports is improved.
Namespace references in conditions are now considered during analysis.
Stops the Astro plugin from adding project patterns.
Runs glob sets containing negations separately.
Includes all groups when negating entry patterns in production mode.
Prevents negated entry patterns from leaking into project patterns.
Includes side-effect imports in module analysis.
Fixes handling of TYPE_ONLY instances during analysis.
Restores and adds workarounds for TypeScript compatibility.
Knip now correctly recognizes the Node environment in Vitest-related analysis.
Improves pragma handling and setup during analysis.
Improves handling of side effects and opaque import calls during analysis.
Some export and import positions are improved, making reported issue locations more accurate.
Import identifier and specifier positions are corrected, improving the locations reported for related issues.
Namespace import positions are corrected, making reported issue locations more accurate.
Next.js page extensions are now applied to the app directory, improving file detection for projects using custom page extensions.
create-config now correctly detects packages in pnpm-workspace.yaml.
Issue type shorthands were fixed.
KnipConfig can now be provided as an async function.
Wildcard-ignored workspaces can now be un-ignored.
Zod errors were improved, providing clearer diagnostics when validation fails.
Re-supports astro:env/* imports so Knip can handle projects using these Astro environment imports.
Fixes how plugin specifiers are handled in the remark plugin.
The tailwind compiler now imports default exports correctly, improving handling of Tailwind code analyzed by Knip.
Adds support for Node.js 18.
--fix is now enabled when --fix-types or --allow-remove-files is set.
Fixes an issue where fixing an unused exported type removed one character too many.
Unwanted duplicate reports are no longer produced when reporting is disabled.
Rules are turned off when their corresponding issue type is disabled.
Negated patterns from package.json#exports are now handled correctly.
The progress flag behavior was fixed.
Watch mode now replays issues that were previously unretained.
The Eleventy API was updated to add addBundle() support.
Errors now explain JSON5 support when JSON input causes a parsing problem.