@nx/enforce-module-boundaries errors not being displayed inline inside VS Code

Discussão em 'Angular' iniciado por Jop, Janeiro 7, 2025.

  1. Jop

    Jop Guest

    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.

    [​IMG] 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. [​IMG]

    The EsLint output doesn't show me any errors: [​IMG]

    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.

    Continue reading...

Compartilhe esta Página