{"id":18921,"library":"vue-unused-components-checker","title":"Vue Unused Components Checker","description":"A CLI tool to detect unused `.vue` components in Vue.js projects. Version 1.1.2 (latest as of May 2021) scans the file tree for `.vue` files and checks if they are imported and used anywhere. It supports limiting open files for large directories and ignoring glob patterns (e.g., node_modules). The tool is simple, focused, and works with Vue 2 projects. It is not actively maintained (no releases since 2021). Alternatives like `eslint-plugin-vue` with `no-unused-components` provide deeper analysis.","status":"maintenance","version":"1.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/BerniWittmann/vue-unused-components-checker","tags":["javascript","check","vue","unused","components"],"install":[{"cmd":"npm install vue-unused-components-checker","lang":"bash","label":"npm"},{"cmd":"yarn add vue-unused-components-checker","lang":"bash","label":"yarn"},{"cmd":"pnpm add vue-unused-components-checker","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"For file pattern matching","package":"glob","optional":false}],"imports":[{"note":"Package is ESM-only. CommonJS require will fail.","wrong":"const checkUnusedComponents = require('vue-unused-components-checker')","symbol":"checkUnusedComponents","correct":"import { checkUnusedComponents } from 'vue-unused-components-checker'"}],"quickstart":{"code":"import { checkUnusedComponents } from 'vue-unused-components-checker';\nconst path = require('path');\nconst results = checkUnusedComponents({\n  rootDir: path.resolve('./src'),\n  ignorePatterns: ['**/node_modules/**'],\n  maxOpenFiles: 50\n});\nconsole.log(results.unused);","lang":"typescript","description":"Programmatic usage that scans src/ directory for unused .vue components and logs the list."},"warnings":[{"fix":"Run `check-unused-comp .` instead of trying to run the package name directly.","message":"CLI command is 'check-unused-comp', not 'vue-unused-components-checker'","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Use `import` syntax or set `\"type\": \"module\"` in your package.json.","message":"CommonJS require does not work; package is ESM-only","severity":"breaking","affected_versions":">=1.0"},{"fix":"Switch to eslint-plugin-vue for better maintenance and integration.","message":"No updates since 2021; consider migrating to eslint-plugin-vue with no-unused-components rule","severity":"deprecated","affected_versions":">=1.0"},{"fix":"Use `-o 20` (no equals sign) to limit open files.","message":"Max open files option is -o but takes a number without flag name, e.g., -o 20","severity":"gotcha","affected_versions":">=1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use `check-unused-comp .` instead of `vue-unused-components-checker .`","cause":"CLI command called incorrectly; package might be installed globally but command name is different.","error":"Error: Cannot find module 'vue-unused-components-checker'"},{"fix":"Use `import { checkUnusedComponents } from 'vue-unused-components-checker'` or convert project to ESM.","cause":"Using CommonJS require on an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Use `-o 20` to limit open files and avoid hitting the OS path length limit.","cause":"File paths too long when scanning large directories with many nested folders.","error":"ENAMETOOLONG: name too long"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}