-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
NX doesn't throw the lint error when buildable library depends on itself. Lint passes without any errors. The build fails. #16187
Comments
Thank you for reporting the error @nikbabchenko. Please make sure to have a single lock file and that this lock file is in sync with package.json so that reproducing the issue is accurate.
|
@meeroslav, need to mention, the ' ui-kit-core-core' has been generated via NX console. btw, @meeroslav, since the library is buildable. It needs it's own ng-package.json, correct? In v13 of nx-workspace it works as expected. btw, could you still build the library after removing 'ng-package.json'? |
You are correct. Sorry for being so fast with my conclusions. v13 ignored secondary entry points, so this was treated as any other code. Unfortunately, the latest fix does not consider the buildable libs to have also |
Thanks for tracking this one, because having the NX in order to control boundaries in combination with 'Webstorm' or 'Idea' adds issues with circular imports the library on itself. (Idea and Webstorm auto-import the library itself. For sure it's configurable and could be fixed, but eslint accepts such imports currently) NX doesn't handle this scenario. So, basically you have to additionally add lint rules to handle self imports. |
I have created the fix. Unfortunately, you will have to be a bit more patient until it's released. Thank you again for reporting it. |
@meeroslav I noticed a regression after #16367. In my case I have a buildable angular library which has secondary entry points which import the primary entry point. @flagship-create/async-store -> @flagship-create/async-store/indexeddb When it tries to check the import of |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Hey @wSedlacek sorry for the late reply. Please create a separate issue and link it to this one. |
Current Behavior
Importing the buildable library from itself via '@some-lib-path' doesn't throw any lint errors.
Nx lint passes.
Build fails.
Expected Behavior
Importing library from the same library should throw error - about relative paths.
"Projects should use relative imports to import from other files within the same project. Use "./path/to/file" instead of import" (nx-enforce-boundaries)
GitHub Repo
nrwl/nx-examples#271
Steps to Reproduce
3. Observe - there are no any lint errors.
Nx Report
Failure Logs
Additional Information
No response
The text was updated successfully, but these errors were encountered: