Skip to content

@nx/dependency-checks: add option for allowing dependencies to be satisfied by depending on their direct dependents #29853

@Hotell

Description

@Hotell

Update

after additional convo this is actually a feature request

#29853 (comment)


Current Behavior

includeTransitiveDependencies does not work as expected (doesn't work at all? )

when enabled it doesn't parse transitive dependencies correctly and throws wrong lint errors

Image

Error:

fluentui-contrib/packages/react-data-grid-react-window/package.json
  4:3  error  The "react-data-grid-react-window" project uses the following packages, but they are missing from "dependencies":
    - @fluentui/react-utilities
    - @fluentui/react-table  @nx/dependency-checks

Source to problematic imports:

react-components dependencies:

Expected Behavior

includeTransitiveDependencies should traverse children and properly resolve lint issues

GitHub Repo

https://github.com/Hotell/fluentui-contrib/tree/migrate-to-version-plans

Steps to Reproduce

  1. checkout https://github.com/Hotell/fluentui-contrib/tree/migrate-to-version-plans
  2. run yarn
  3. run yarn nx run react-data-grid-react-window:lint

Nx Report

NX   Report complete - copy this into the issue template

Node           : 20.18.0
OS             : darwin-arm64
Native Target  : aarch64-macos
yarn           : 1.23.34

nx                     : 20.2.2
@nx/js                 : 20.2.2
@nx/jest               : 20.2.2
@nx/eslint             : 20.2.2
@nx/workspace          : 20.2.2
@nx/cypress            : 20.2.2
@nx/devkit             : 20.2.2
@nx/eslint-plugin      : 20.2.2
@nx/module-federation  : 20.2.2
@nx/playwright         : 20.2.2
@nx/plugin             : 20.2.2
@nx/react              : 20.2.2
@nx/storybook          : 20.2.2
@nx/vite               : 20.2.2
@nx/web                : 20.2.2
@nx/webpack            : 20.2.2
typescript             : 5.6.3
---------------------------------------
Local workspace plugins:
         @fluentui-contrib/nx-plugin

Failure Logs

Package Manager Version

yarn

Operating System

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

Additional Information

when checking actual source of this rule, it uses the flag within this function to set seen Set https://github.com/nrwl/nx/blob/master/packages/js/src/utils/find-npm-dependencies.ts#L35-L37

and then recursively call collectAll https://github.com/nrwl/nx/blob/master/packages/js/src/utils/find-npm-dependencies.ts#L67-L73

I checked tests for this logic but wasn't able to find anything

No response

Metadata

Metadata

Assignees

Labels

priority: lowLow Priority (does not affect many people or not severely or has an easy workaround)scope: linterIssues related to Eslint support in Nxtype: feature

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions