Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add devDependencies support & regex ignored dependencies to @nx/dependency-checks #30619

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

nwidynski
Copy link

@nwidynski nwidynski commented Apr 5, 2025

This (non-breaking) PR adds support for multiple configuration objects as well as a production flag to the dependency-checks eslint rule. This is similar to how https://knip.dev/features/production-mode works.

With this change, it is now possible to enforce presence of devDependencies for dev-only files, e.g. .spec, like so:

// ...
"@nx/dependency-checks": ["error", 
  { "ignoredFiles": ["**/*.spec.ts"] }, 
  { "production": false, "ignoredFiles": ["**/!(*.spec.ts)"] }
]

Furthermore, this PR also adds capability to match dependencies via regex pattern in the ignoredDependencies.

Current Behavior

It is impossible to enforce dev-only dependencies.

Expected Behavior

Related Issue(s)

Fixes #30614

@nwidynski nwidynski requested a review from a team as a code owner April 5, 2025 22:38
@nwidynski nwidynski requested a review from leosvelperez April 5, 2025 22:38
Copy link

vercel bot commented Apr 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Apr 8, 2025 9:41pm

@nwidynski nwidynski marked this pull request as draft April 5, 2025 22:58
@nwidynski nwidynski marked this pull request as ready for review April 6, 2025 00:02
@nwidynski nwidynski changed the title feat: add multi config support to @nx/dependency-checks feat: add devDependencies support & regex ignored dependencies to @nx/dependency-checks Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@nx/dependency-checks fails on missing dev dependencies
1 participant