nx: imports of lazy-loaded libraries are forbidden due to name collision
I have a lib called ‘order’, which is lazy-loaded, and a lib called ‘oder-api’, which isn’t lazy loaded.
TSLint gives me the following error on a import of the OrderApiModule (from ‘order-api’).
[tslint] imports of lazy-loaded libraries are forbidden (nx-enforce-module-boundaries)
As far as I could figure out there is some name collision with the ‘order’ lib, because if I rename the ‘order-api’ libs folder to something like ‘apiorder’, the error is not displayed anymore. For renaming it ‘orderapi’ (without dash) I also get the error.
Version info:
"@nrwl/nx": "0.7.4",
"tslint": "5.9.1",
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (10 by maintainers)
@FallenRiteMonk great to hear!
I try to add some tests, I hope the pr will get merged then …
with
allowyou can set a list of import paths that are allowed no matter where you import from it (eg.allow: ["../../libs/mylib/some.component", "../../libs/my-other-lib/other.component"]). it is a white list of allowed import paths.allowing globs here would be nice, but at the moment it has to match exactly…
@ThomasBurleson event with 0.8.0 I get the same error message.
Furthermore I noticed that by installing 0.8.0 one gets the following message displayed:
This is a bit misleading because one hast to run
npm run nx-migratefirst, so that the ‘nx-migrate’ script gets renamed to ‘update’.