Generated: 2026-09-03 Tool: Knip v0.65.x Project: Agama Web
Knip analysis found:
- 27 unused files
- 8 unused devDependencies
- 7 unlisted dependencies (used but not in package.json)
- 64 unused exports
Created knip.json config and completed manual review:
- 8 unused files (19 were false positives - translation files, build scripts)
- 5 truly unused devDependencies (3 are peer deps of neostandard)
- 9 unlisted dependencies (CRITICAL - must add to package.json)
- 38 unused exports (26 were OpenAPI types)
✅ READY TO EXECUTE:
- Add 6 missing dependencies (2 runtime + 4 dev)
- Remove 5 unused devDependencies
- Consider removing 8 unused files after verification
@monaco-editor/react,@patternfly/react-icons(runtime)@jest/globals,glob,gettext-parser,jed(dev/build)
These files are used outside the normal import graph:
svgo.config.js- SVGO configuration for SVG optimizationscripts/check-contrast.js- Development utility script (executable)share/po/po-converter.js- Translation file converter (executable)share/po/po.template.js- Translation template
Reason: Used by build tools or as standalone scripts, not imported directly.
All src/po/po.*.js files:
po.ca.js,po.de.js,po.es.js,po.fr.js,po.id.js,po.it.js,po.ja.js,po.ka.jspo.pt-BR.js,po.ru.js,po.sv.js,po.tr.js,po.uk.js,po.zh-CN.js,po.zh-TW.js
Reason: Loaded dynamically via import(\~/po/po.${language}.js`)insrc/test-utils.tsx` and runtime. Knip cannot detect dynamic imports with template literals.
src/components/core/SelectTypeaheadCreatable.tsx- Component not imported anywheresrc/components/storage/AutoSizeText.tsx- Component not imported anywheresrc/components/storage/SizeModeSelect.tsx- Component not imported anywhere
src/components/l10n/index.ts- Export barrel, but exports aren't usedsrc/components/network/index.ts- Export barrel, but exports aren't usedsrc/components/users/index.ts- Export barrel, but exports aren't used
Action: These appear to be dead code. Before removing:
- Grep for any dynamic imports or runtime references
- Check if they're part of incomplete features
- Ask: Are these planned for future use?
src/hooks/use-cancellable-promise.ts- Hook not imported anywheresrc/hooks/model/config/user.ts- Hook not imported anywhere
Action: Safe to remove if truly unused. Check git history for context.
-
@babel/eslint-parser(package.json:28)- ✅ Not used in eslint.config.mjs (uses
@typescript-eslint/parserinstead) - SAFE TO REMOVE
- ✅ Not used in eslint.config.mjs (uses
-
@svgr/plugin-jsx(package.json:33)- ✅ Not configured in webpack.config.js
- SAFE TO REMOVE
-
ajv(package.json:46)- ✅ Not imported anywhere in src/ or config files
- SAFE TO REMOVE
-
eslint-plugin-node(package.json:58)- ✅ Deprecated package, replaced by
eslint-plugin-n - SAFE TO REMOVE
- ✅ Deprecated package, replaced by
-
eslint-plugin-import-x(package.json:56)- ✅ Not configured in eslint.config.mjs
- ✅ Not imported or used
- SAFE TO REMOVE
-
eslint-plugin-n(package.json:57)- ✅ Used by neostandard (peer dependency)
- Used in rules:
"n/no-callback-literal": "off"(line 94) - KEEP
-
eslint-plugin-promise(package.json:60)- ✅ Used by neostandard (peer dependency)
- KEEP
-
eslint-plugin-react(package.json:61)- ✅ Used by neostandard (peer dependency)
- Used in rules:
"react/jsx-curly-spacing","react/jsx-indent-props","react/prop-types"(lines 90-92) - KEEP
These packages are USED but NOT in package.json:
@jest/globals- Used in: 4 test files (transformations.test.ts)
- ACTION:
npm install -D @jest/globals
glob,gettext-parser,jed- Used in:
share/po/po-converter.js(build script for translations) - ACTION:
npm install -D glob gettext-parser jed
- Used in:
-
@monaco-editor/react- Used in:
src/components/core/ConfigEditor.tsx:28 - ACTION:
npm install @monaco-editor/react
- Used in:
-
@patternfly/react-icons- Used in:
src/components/core/SmallWarning.tsx:25 - Deep import:
@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon - ACTION:
npm install @patternfly/react-icons
- Used in:
typescript-eslint- Used in:
eslint.config.mjs:4 - Provided by:
neostandard@0.13.0→typescript-eslint@8.63.0 - STATUS: Installed indirectly, keep as transitive dependency
- Used in:
-
Type-only exports from OpenAPI generated files (majority)
- Files:
src/openapi/**/*.ts - These are auto-generated type definitions
- KEEP - Part of the API contract, may be used externally or in future
- Files:
-
Component exports from index.ts barrel files
- Multiple exports from
src/components/*/index.ts - Examples:
ChangeProductOption,FormLabel,EmailInput,MenuHeader, etc. - ACTION: If the barrel file is unused (see section 1.3), remove it entirely
- Otherwise, clean up individual unused exports
- Multiple exports from
-
Utility function exports
- Various utility functions in utils files
- Examples:
setLocationSearch,intRange,volumeLabel, etc. - ACTION: Review each on a case-by-case basis
-
Test utility exports
mockUseRevalidatorinsrc/test-utils.tsx- ACTION: Remove if truly unused in tests
-
Add missing dependencies:
# Runtime dependencies npm install @monaco-editor/react @patternfly/react-icons # Dev dependencies for tests and build scripts npm install -D @jest/globals glob gettext-parser jed
-
Remove unused devDependencies (5 packages):
npm uninstall @babel/eslint-parser @svgr/plugin-jsx ajv eslint-plugin-import-x eslint-plugin-node
Impact:
- Add: 6 packages total (2 runtime, 4 dev)
- Remove: 5 dev packages
- Net change: +1 package, but fixes all unlisted dependency issues
Investigation complete. Results:
- ✅ eslint-plugin-n, eslint-plugin-promise, eslint-plugin-react are used by neostandard - KEEP
- ✅ @svgr/plugin-jsx not in webpack config - REMOVE
- ✅ ajv not used anywhere - REMOVE
- ✅ @babel/eslint-parser not used - REMOVE
- ✅ eslint-plugin-import-x not configured - REMOVE
-
Remove unused components (if confirmed):
src/components/core/SelectTypeaheadCreatable.tsxsrc/components/storage/AutoSizeText.tsxsrc/components/storage/SizeModeSelect.tsx
-
Remove unused hooks:
src/hooks/use-cancellable-promise.tssrc/hooks/model/config/user.ts
-
Remove or clean up index.ts files:
src/components/l10n/index.tssrc/components/network/index.tssrc/components/users/index.ts
-
Clean up unused exports (carefully, one at a time)
Created knip.json configuration file to reduce false positives.
Results after configuration:
- Unused files: 27 → 8 (eliminated 19 false positives)
- Unused devDependencies: Still shows 8 (3 are false positives from neostandard)
- Unlisted dependencies: 7 → 9 (found 3 more in build scripts)
- Unused exports: 64 → 38 (eliminated 26 false positives)
Additional unlisted dependencies found:
glob,gettext-parser,jed- Used inshare/po/po-converter.js- These are likely dev dependencies for the build process
- Dynamic imports with template literals - po.* files
- Config files used by tools (svgo.config.js)
- Executable scripts not imported (scripts/*)
- Transitive dependencies via neostandard
- Generated types in openapi/ folders
- Deep imports from packages (react-icons sub-paths)
- ✅ Phase 1: Installed Knip and ran initial analysis
- ✅ Phase 2: Categorized all findings and identified false positives
- ✅ Phase 3: Created knip.json configuration to reduce noise
Unused devDependencies:
- 5 confirmed removable:
@babel/eslint-parser,@svgr/plugin-jsx,ajv,eslint-plugin-import-x,eslint-plugin-node - 3 false positives (used by neostandard):
eslint-plugin-n,eslint-plugin-promise,eslint-plugin-react
Unlisted dependencies:
- 6 critical additions needed:
@monaco-editor/react,@patternfly/react-icons,@jest/globals,glob,gettext-parser,jed - 1 transitive dependency (OK):
typescript-eslint(via neostandard)
Unused files:
- 8 potentially removable files (components, hooks, index.ts barrel files)
- 19 false positives eliminated by configuration (po files, build scripts)
Unused exports:
- 38 remaining (down from 64)
- Most are intentional API surface or will be cleaned up when barrel files are removed
- ✅ Phase 1: Analysis complete
- ✅ Phase 2: Review and categorization complete
- ✅ Phase 3: Configuration complete
- ⏭️ Next: Execute Phase A (Critical Fixes) - awaiting approval
- ⏭️ Future: Execute Phase C (Code Cleanup) - awaiting approval
.claude/knip-report.json- Full machine-readable Knip output.claude/dependency-analysis.md- This analysis document (you are reading this).claude/plans/sanitize-deps.md- Original plan document (updated)
knip.json- Knip configuration file- Currently untracked
- DECISION NEEDED: Should this be committed to the repository?
- Pros: Team benefits from reduced false positives
- Cons: Adds another config file to maintain
package.json- Will be modified when Phase A is executedpackage-lock.json- Will be updated when dependencies are installed/removed