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

Deleting config lib files make affected command take every projects as affected #29699

Closed
1 of 4 tasks
antoineducrot opened this issue Jan 21, 2025 · 1 comment
Closed
1 of 4 tasks
Assignees
Labels
scope: core core nx functionality type: bug

Comments

@antoineducrot
Copy link

antoineducrot commented Jan 21, 2025

Current Behavior

When deleting the .eslintrc.json file for example inside a library in an Nx workspace, the nx affected command unexpectedly considers all projects as affected. This behavior is unexpected because the .eslintrc.json file is specific to a single library and should not impact the entire workspace.

Expected Behavior

Nx should only mark the library (and potentially its dependents) as affected rather than the entire workspace.

GitHub Repo

[email protected]:nrwl/nx-examples.git

Steps to Reproduce

  1. Delete the .eslintrc.json file from a specific library.

  2. Run: nx affected test

  3. Observe that Nx considers all projects as affected.

Nx Report

NX   Report complete - copy this into the issue template

Node           : 22.11.0
OS             : darwin-arm64
Native Target  : aarch64-macos
yarn           : 4.2.2

nx                     : 20.3.0-rc.0
@nx/js                 : 20.3.0-rc.0
@nx/jest               : 20.3.0-rc.0
@nx/eslint             : 20.3.0-rc.0
@nx/workspace          : 20.3.0-rc.0
@nx/angular            : 20.3.0-rc.0
@nx/cypress            : 20.3.0-rc.0
@nx/devkit             : 20.3.0-rc.0
@nx/eslint-plugin      : 20.3.0-rc.0
@nx/module-federation  : 20.3.0-rc.0
@nx/react              : 20.3.0-rc.0
@nx/web                : 20.3.0-rc.0
@nx/webpack            : 20.3.0-rc.0
typescript             : 5.6.3
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/cypress/plugin
@nx/jest/plugin
---------------------------------------
Community plugins:
@ngrx/component-store : 19.0.0
@ngrx/effects         : 19.0.0
@ngrx/entity          : 19.0.0
@ngrx/operators       : 19.0.0
@ngrx/router-store    : 19.0.0
@ngrx/store           : 19.0.0
@ngrx/store-devtools  : 19.0.0

Failure Logs

Package Manager Version

No response

Operating System

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

Additional Information

No response

@AgentEnder
Copy link
Member

This is expected on our end, although I can understand why it may be unexpected for users. When using plugins that identify project configurations, any file that the plugin matches could theoretically create a project. Additionally, if a project was removed we always mark everything as affected.

The combination of these 2 statements means that if a file identified as potentially containing projects info is removed, the graph lights up

@AgentEnder AgentEnder added the scope: core core nx functionality label Jan 22, 2025
@AgentEnder AgentEnder self-assigned this Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core core nx functionality type: bug
Projects
None yet
Development

No branches or pull requests

2 participants