fix-knip-unused-exports

Apply category-specific fix strategies to resolve knip unused export violations in TypeScript projects.

Updated Jul 13, 2026
One-click install
npx skills add https://github.com/ElbertePlinio/dotfiles --skill fix-knip-unused-exports-elberteplinio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fix-knip-unused-exports
Source: https://github.com/ElbertePlinio/dotfiles/tree/main/private_dot_factory/plugins/marketplaces/factory-plugins/plugins/typescript/skills/fix-knip-unused-exports
Command: npx skills add https://github.com/ElbertePlinio/dotfiles --skill fix-knip-unused-exports-elberteplinio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the guesswork and manual effort of resolving knip "Unused exports" violations in TypeScript projects, providing clear, category-specific fix strategies that adhere to common project lint rules.

Core Features & Use Cases

  • Violation Classification: Categorizes unused export issues into test-only exports, dead barrel re-exports, internally-only used exports, and dead code to apply the correct fix for each type.
  • Monorepo Support: Handles barrel re-export cleanup for multi-package projects, including adding required subpath exports to avoid breaking cross-package test imports.
  • Lint Rule Compliance: Ensures fixes align with common TypeScript lint rules like filename-match-export, test-imports-source, and constants-file-organization.
  • Use Case: For a TypeScript monorepo where knip flags unused exports across multiple packages, use this Skill to apply correct fixes while passing all validation checks (knip, typecheck, test, lint).

Quick Start

Use the fix-knip-unused-exports skill to resolve all unused export violations reported by npm run knip in your TypeScript project.

Frequently Asked Questions about fix-knip-unused-exports

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix knip unused exports violations in a TypeScript project?

Resolve knip unused exports in TypeScript projects by applying category-specific fix strategies that handle test-only exports, dead barrel re-exports, internally-only used exports, and dead code cleanup.

What is the best way to clean up dead barrel re-exports in a TypeScript monorepo?

Clean up dead barrel re-exports in a TypeScript monorepo by removing unused exports and adding required subpath exports to prevent breaking cross-package test imports during the file cleanup process.

Does fixing unused exports with knip work with existing TypeScript lint rules?

Fixing unused exports with knip works with existing TypeScript lint rules by ensuring fixes align with filename-match-export, test-imports-source, and constants-file-organization conventions.

Can I resolve knip violations in a TypeScript monorepo without breaking cross-package test imports?

You can resolve knip violations in a TypeScript monorepo without breaking cross-package test imports by adding required subpath exports during the barrel re-export cleanup process.

Why does knip flag test-only exports as unused and how should I handle them?

Knip flags test-only exports as unused because they lack production consumers, and you should handle them by applying category-specific fix strategies that satisfy test suite validation while removing dead code.

What are the limitations of automated knip unused exports cleanup in TypeScript codebases?

Automated knip unused exports cleanup in TypeScript codebases requires passing validation checks across typecheck, test, and lint suites, and may need manual intervention for complex cross-package monorepo dependencies.