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

docs: @nx/dependency-checks cannot handle different build target names when resolving project dependencies #29439

Open
1 of 4 tasks
RobbyRabbitman opened this issue Dec 20, 2024 · 0 comments

Comments

@RobbyRabbitman
Copy link

Current Behavior

@nx/dependency-checks resolves projects dependencies via the exact target name of its build target name. This is only documented as a TODO in https://github.com/nrwl/nx/blob/19b0828d278b5fa8e3d9f8fc537b317c7f442848/packages/eslint-plugin/src/rules/dependency-checks.ts#L145C7-L145C96

Expected Behavior

Add docs.

GitHub Repo

https://github.com/RobbyRabbitman/cv/tree/nx-dependencies-checks-issue-2

Steps to Reproduce

  1. check out repo https://github.com/RobbyRabbitman/cv/tree/nx-dependencies-checks-issue-2
  2. run nx-dependency-checks-issue.sh

Nx Report

NX   Report complete - copy this into the issue template

Node           : 22.12.0
OS             : darwin-arm64
Native Target  : aarch64-macos
pnpm           : 9.15.0

nx (global)        : 20.1.4
nx                 : 20.2.2
@nx/js             : 20.2.2
@nx/eslint         : 20.2.2
@nx/devkit         : 20.2.2
@nx/eslint-plugin  : 20.2.2
@nx/vite           : 20.2.2
typescript         : 5.6.2
---------------------------------------
Registered Plugins:
@nx/js/typescript
@nx/eslint/plugin
@robby-rabbitman/cv-tools-nx-eslint-dependency-checks-plugin
@robby-rabbitman/cv-tools-nx-angular-plugin
@nx/vite/plugin
@robby-rabbitman/cv-tools-nx-sonar-scan-plugin
---------------------------------------
Community plugins:
@ngrx/signals  : 18.1.1
angular-eslint : 19.0.2
ngxtension     : 4.2.0

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

A solution - if implementation should be untouched - can be a plugin which adds a pseudo build target to every project and reference this name in the eslint rule config for @nx/dependency-checks. A working example can be found in the repo specified above:

https://github.com/RobbyRabbitman/cv/blob/3a5a34c13630adbaedae08b6727a1230d7dd7831/nx.json#L130-L132
https://github.com/RobbyRabbitman/cv/blob/3a5a34c13630adbaedae08b6727a1230d7dd7831/tools/eslint/src/eslint.config.nx.ts#L11-L36
https://github.com/RobbyRabbitman/cv/blob/3a5a34c13630adbaedae08b6727a1230d7dd7831/tools/nx-eslint-dependency-checks-plugin/src/nx-eslint-dependency-checks-plugin.ts#L17-L55

@RobbyRabbitman RobbyRabbitman changed the title docs: @nx/dependency-checks cannot handle different build target names of when resolving project dependencies docs: @nx/dependency-checks cannot handle different build target names when resolving project dependencies Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant