-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Current Behavior
In a monorepo that uses npm workspaces and relies on package name imports instead of path aliases, and each project’s package.json does not define a main or exports field. We are seeing issues when using @nx/eslint-plugin and @nx/eslint
The @nx/enforce-module-boundaries rule is not enforced because Nx’s target project locator fails to resolve the target project correctly.
In the example PR, running:
nx run cart:lint --skip-nx-cache
from the repo root does not produce the expected linting errors:
Expected Behavior
Running the above nx command should throw linting errors, just as native eslint does:
npx eslint 'apps/cart/**/*.{ts,tsx,js,jsx}' --cache=false
GitHub Repo
Steps to Reproduce
- Checkout the branch
- yarn install
- in the root, run: nx run cart:lint --skip-nx-cache
- in the root, run: npx eslint 'apps/cart/**/*.{ts,tsx,js,jsx}' --cache=false
Nx Report
Node : 22.21.0
OS : darwin-arm64
Native Target : aarch64-macos
yarn : 4.2.2
nx (global) : 21.0.3
nx : 22.4.0-beta.0
@nx/js : 22.4.0-beta.0
@nx/eslint : 22.4.0-beta.0
@nx/workspace : 22.4.0-beta.0
@nx/angular : 22.4.0-beta.0
@nx/jest : 22.4.0-beta.0
@nx/cypress : 22.4.0-beta.0
@nx/devkit : 22.4.0-beta.0
@nx/eslint-plugin : 22.4.0-beta.0
@nx/module-federation : 22.4.0-beta.0
@nx/react : 22.4.0-beta.0
@nx/rollup : 22.4.0-beta.0
@nx/rspack : 22.4.0-beta.0
@nx/vite : 22.4.0-beta.0
@nx/vitest : 22.4.0-beta.0
@nx/web : 22.4.0-beta.0
@nx/webpack : 22.4.0-beta.0
typescript : 5.9.2
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/cypress/plugin
@nx/jest/plugin
---------------------------------------
Community plugins:
@ngrx/component-store : 21.0.0
@ngrx/effects : 21.0.0
@ngrx/entity : 21.0.0
@ngrx/operators : 21.0.0
@ngrx/router-store : 21.0.0
@ngrx/store : 21.0.0
@ngrx/store-devtools : 21.0.0
---------------------------------------
Cache Usage: 1.96 KB / 46.04 GBFailure Logs
Package Manager Version
No response
Operating System
- macOS
- Linux
- Windows
- Other (Please specify)
Additional Information
No response
Reactions are currently unavailable