I've created a new Nx workspace and setup some @nx/enforce-module-boundaries
rules. When running the nx lint
command manually I get the errors I expect when importing a module where I'm not supposed to.
nx run-many --all --target=lint
√ nx run admin:lint [existing outputs match the cache, left as is]
√ nx run admin-customer-shell:lint [existing outputs match the cache, left as is]
√ nx run admin-e2e:lint [existing outputs match the cache, left as is]
× nx run admin-customer-feature-feature-list:lint
Linting "admin-customer-feature-feature-list"...
> NX Running target lint for 4 projects
D:\Projects\LittleSalon\little-salon\libs\admin\customer\feature\feature-list\src\lib\feature-list.module.ts
3:1 error A project tagged with "type:feature" can only depend on libs tagged with "type: feature", "type:data-access", "type: ui", "type: utils", "type: models" @nx/enforce-module-boundaries
✖ 1 problem (1 error, 0 warnings)ature-feature-list:lint
Lint errors found in the listed files.che]
But in my IDE (Vs Code) I don't get the same error inline. So when working, it all seems fine. I ofcourse want immediate feedback whilst working on my app and not only in my CI/CD pipeline.
In this example I expect an error on line 3, because my boundary rules do not allow shells to be imported inside features.
I've made my repository public so you can see the source code: https://github.com/JREU/LittleSalon
I've deinstalled all extensions except for EsLint, Nx Console and prettier.
The EsLint output doesn't show me any errors:
Here's my settings.json file:
{
"git.enableSmartCommit": true,
"workbench.iconTheme": "material-icon-theme",
"javascript.updateImportsOnFileMove.enabled": "always",
"explorer.confirmDelete": false,
"git.autofetch": true,
"files.autoSave": "afterDelay",
"git.confirmSync": false
}
Edit: As a test I've installed Rider, which does give me inline errors. So it seems to be a VS Code issue.
Ok I managed to resolve this issue myself by doing a clean install of VS Code. I'm on Windows, so I followed the following steps:
code
folder from the roaming folder C:\Users\<your-pc-username>\AppData\Roaming\
..vscode
folder from C:\Users\<your-pc-username>\
Source: https://shihab1511.medium.com/clean-uninstall-vs-code-windows-pc-to-start-afresh-facaec6f5bf2
As of now I still do not know which of my settings/extensions caused the issue.