Closed qortex closed 2 years ago
Well, just an ESLint server reset fixed the issue, so it was just a temporary glitch somehow.
Hum, happens again in another place (wrongly detects circular dependency because it thinks it refers to the main app but it's a lib).
Any pointer as to how to debug & workaround?
Disappeared again after several resets. Definitely something going on with caching or something.
I have this exact same problem using WebStorm and it seems to be a caching issue similar to the one in #8313.
Can confirm that the following suggestion in that issue works for me https://github.com/nrwl/nx/issues/8313#issuecomment-1008774008
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.
Current Behavior
I use the architecture advised in the angular architecture book by the Nx team:
Then I use the
enforce-module-boundaries
to make sure libs are properly imported.But from the
booking
app, if Iimport '@myproject/booking/feature-shell
, I get this error:Linting error with
eslint (@nrwl/nx/enforce-module-boundaries)
:Projects should use relative imports to import from other files within the same project.
I understand it's because
@myproject/booking
is misinterpreted as pointing toapps/booking
, where it's not the case, it's just that the schematics builder also uses@myproject/booking
to point tolibs
libs.Indeed, changing the name of the lib by hand in
tsconfig.base
to@myproject/libs/booking/feature-shell
for example fixes the issue. But I would like to stick to out-of-the-box naming because otherwise it defeats the use of the schematics builder.Expected Behavior
I would expect the linting rule to work out of the box with the given example.
I don't know if it's a regression (probably, since the book was written?)
Environment