Skip to content
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-enforce-module-boundaries allow one-level-deep wildcard import does not work #2076

Closed
aag5586 opened this issue Nov 19, 2019 · 2 comments
Closed

Comments

@aag5586
Copy link
Contributor

aag5586 commented Nov 19, 2019

Expected Behavior

The following exception to the nx-enforce-module-boundaries lint rule should allow importing any module that is one-level deep inside the "mylibrary" library.

{
  "nx-enforce-module-boundaries": [
    true,
    {
      "allow": ["@myorg/mylibrary/*"],
      "depConstraints": [
        {
          "sourceTag": "*",
          "onlyDependOnLibsWithTags": ["*"]
        }
      ]
    }
  ]
}

Current Behavior

With the above rule, the linter always fails on the following import: import @myorg/mylibrary/a

Failure Information (for bugs)

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. yarn create nx-workspace myorg --preset=“angular” --appName=“demo”
  2. yarn ng g @nrwl/angular:library mylibrary --publishable --style=css
  3. yarn ng g @nrwl/angular:library sublibrary --directory=mylibrary --publishable --simpleModuleName --style=css
  4. Remove "mylibrary-sublibrary” projects from ./angular.json and ./nx.json
  5. Update ./tslint.json “nx-enforce-module-boundaries” rule:
    • add @myorg/mylibrary/* to allow array
  6. Update ./apps/demo/src/app/app.module.ts:
    • add import { SublibraryModule } from '@myorg/mylibrary/sublibrary’;
  7. Run yarn lint demo

Context

Please provide any relevant information about your setup:

Workspace created with create-nx-workspace@8.7.1

nx report from within created workspace:
@nrwl/angular : 8.7.1
@nrwl/cli : 8.7.1
@nrwl/cypress : 8.7.1
@nrwl/eslint-plugin-nx : Not Found
@nrwl/express : Not Found
@nrwl/jest : 8.7.1
@nrwl/linter : Not Found
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 8.7.1
@nrwl/web : Not Found
@nrwl/workspace : 8.7.1
typescript : 3.4.5

@wyers
Copy link

wyers commented Nov 27, 2019

i found it passes when i place a tailing slash after the wildcard

@vsavkin vsavkin closed this as completed in feca793 Dec 1, 2019
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants