No enforce boundaries lint error when importing a non project file #20408
Labels
outdated
scope: core
core nx functionality
scope: linter
Issues related to Eslint support in Nx
type: bug
Current Behavior
When you import a file that is not part of a project by the relative path that goes outside of the current project root, the eslint rule @nx/enforce-module-boundaries is not throwing an error. When you do the same relative import for a file that belongs to a project it shows the error as expected.
Expected Behavior
We want to prevent any relative import outside the project root, it doesn't matter if the relative import is a project file or a non-project file. Currently the linting works for project files but not for non-project files which can cause unexpected behavior
GitHub Repo
nrwl/nx-examples#311
Steps to Reproduce
I created a reproduce-able scenario for this issue in nx-examples:
a. non-project:
libs/shared/product/components/non-project/index.ts
b. project:
libs/shared/product/components/project/project.json
libs/products/home-page/src/lib/products-home-page.module.ts
a. When you change the project component import to the npm scoped import this import is also ok.
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: