Nx 16.4 introduced the `@nx/dependency-checks` ESLint rule to help manage peer dependencies in buildable or publishable Nx library projects. The rule checks for missing dependencies, obsolete dependencies, and version mismatches between the library's `package.json` and the workspace. Setup requires enabling the rule in `.eslintrc.json` with the `jsonc-eslint-parser`, adding `package.json` and `project.json` to lint file patterns, and configuring options like `buildTargets`, `checkMissingDependencies`, `checkObsoleteDependencies`, `checkVersionMismatches`, and `ignoredDependencies`. Lint fixers are available for automated resolution of most issues. The rule replaces the older `updateBuildableProjectDepsInPackageJson` and `buildableProjectDepsInPackageJsonType` executor options, which are deprecated as of Nx 16.6.
Table of contents
Enabling @nx/dependency-checks in .eslintrc.json Copy link Link copied!Including configuration files in the lint target Copy link Link copied!Configuring @nx/dependency-checks options Copy link Link copied!@nx/dependency-checks lint fixers Copy link Link copied!Ignoring test-setup.ts and similar files Copy link Link copied!Conclusion Copy link Link copied!Sort: