{"id":25166,"library":"deplint","title":"deplint","description":"DepLint (v1.1.3) is a lightweight CLI tool that checks that all require/import statements in your JavaScript/TypeScript code are listed as dependencies in package.json. It scans declared file patterns and verifies that every module referenced exists in the project's dependency tree. Unlike similar tools (e.g., dependency-check, eslint-plugin-import), it is unopinionated about module resolution and focuses solely on dependency declaration completeness. It requires a custom 'deplint' key in package.json to configure file patterns and top-level module directories. Release cadence is low; last release was 2019. No known alternatives with identical configuration style.","status":"maintenance","version":"1.1.3","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/jviotti/deplint","tags":["javascript"],"install":[{"cmd":"npm install deplint","lang":"bash","label":"npm"},{"cmd":"yarn add deplint","lang":"bash","label":"yarn"},{"cmd":"pnpm add deplint","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"deplint is a CLI tool, not a library. Use npx or global install.","wrong":"npm run deplint","symbol":"deplint (CLI)","correct":"npx deplint"},{"note":"The package does not export a default ES module; use CommonJS require.","wrong":"import deplint from 'deplint'","symbol":"deplint module","correct":"const deplint = require('deplint')"},{"note":"TypeScript types may not be bundled; check @types/deplint or declare manually.","wrong":"const { DeplintOptions } = require('deplint')","symbol":"deplint types","correct":"import { DeplintOptions } from 'deplint' // if types exist"}],"quickstart":{"code":"// package.json\n{\n  \"name\": \"my-project\",\n  \"scripts\": {\n    \"lint:deplint\": \"deplint\"\n  },\n  \"deplint\": {\n    \"files\": [\"src/**/*.js\"],\n    \"modules\": [\"src/\"]\n  },\n  \"dependencies\": {\n    \"lodash\": \"^4.17.21\"\n  }\n}\n\n// src/index.js\nconst _ = require('lodash'); // OK\nconst foo = require('nonexistent'); // flagged by deplint","lang":"javascript","description":"Shows how to configure deplint in package.json with scanned files and modules, then run it to catch missing dependencies."},"warnings":[{"fix":"Set 'modules' to an array containing the root of your source (e.g., [\"src\"]), even if you have no sub-components.","message":"The 'modules' field is required and must be an array of directories that are top-level sub-components.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use complementary tools like 'npm-check' or 'depcheck' for unused or mismatched versions.","message":"depLint only checks that imported modules exist as dependencies; it does not validate semver ranges or unused dependencies.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use 'src/**/*.js' instead of 'src/*.js' to scan nested folders.","message":"Glob patterns in 'files' are not recursive by default; '**' must be used for deep scans.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Evaluate if you need a more actively maintained alternative.","message":"No new releases since 2019; the tool is considered feature-stable.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Add the module to package.json dependencies or devDependencies.","cause":"An import or require references a module not present in package.json dependencies (or devDependencies, if configured).","error":"Error: Module 'xxx' is not listed in package.json dependencies"},{"fix":"Add a 'deplint' key to package.json with a 'files' array.","cause":"The 'deplint' key in package.json is missing or has no 'files' property.","error":"TypeError: Cannot read property 'files' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}