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

Lint: changing tags of a library doesn't invalidate the cache of libraries that depend on it #9252

Closed
adrdilauro opened this issue Mar 9, 2022 · 3 comments
Assignees
Labels
blocked: retry with latest Retry with latest release or head. outdated scope: linter Issues related to Eslint support in Nx type: bug

Comments

@adrdilauro
Copy link

adrdilauro commented Mar 9, 2022

Current Behavior

I have lib1 tagged with tag1, and lib2 tagged with tag2.

The eslint rule for @nrwl/nx/enforce-module-boundaries looks like this:

"@nrwl/nx/enforce-module-boundaries": [
  "error",
  {
    "enforceBuildableLibDependency": true,
    "allow": [],
    "depConstraints": [
      {
        "sourceTag": "tag1",
        "onlyDependOnLibsWithTags": ["tag2"]
      },
      ...
    ]
  }
]

Inside lib1 I import a file from lib2, and run the lint. The lint passes because my tag rules allow such a dependency.

Now, I remove tag2 from lib2.

I run lint again, but the linting cache gets invalidated only for lib2, which is the lib I modified, and not for lib1, that depends on it: hence, linting lib1 doesn't fail, as I was expecting.

I clear the cache, run lint again, now it correctly fails for lib1.

Expected Behavior

Lint should fail immediately, without need of clearing the cache.

Steps to Reproduce

  1. Run lint so that the result gets cached
  2. Remove a tag from one of the libs, that will make imports invalid from a second lib that depends on it
  3. Run lint again, without clearing the cache

Environment

Node : 12.22.9
   OS   : linux x64
   npm  : 8.5.0
   
   nx : 13.8.1
   @nrwl/angular : 13.8.1
   @nrwl/cli : 13.8.1
   @nrwl/cypress : 13.8.1
   @nrwl/detox : undefined
   @nrwl/devkit : 13.8.1
   @nrwl/eslint-plugin-nx : 13.8.1
   @nrwl/express : 13.8.1
   @nrwl/jest : 13.8.1
   @nrwl/js : undefined
   @nrwl/linter : 13.8.1
   @nrwl/nest : undefined
   @nrwl/next : undefined
   @nrwl/node : 13.8.1
   @nrwl/nx-cloud : undefined
   @nrwl/react : undefined
   @nrwl/react-native : undefined
   @nrwl/schematics : undefined
   @nrwl/storybook : 13.8.1
   @nrwl/tao : 13.8.1
   @nrwl/web : undefined
   @nrwl/workspace : 13.8.1
   typescript : 4.5.5
   rxjs : 6.5.5
   ---------------------------------------
   Community plugins:
   	 @angular/animations: 13.2.2
   	 @angular/cdk: 13.2.2
   	 @angular/common: 13.2.2
   	 @angular/compiler: 13.2.2
   	 @angular/core: 13.2.2
   	 @angular/forms: 13.2.2
   	 @angular/material: 13.2.2
   	 @angular/material-moment-adapter: 13.2.2
   	 @angular/platform-browser: 13.2.2
   	 @angular/platform-browser-dynamic: 13.2.2
   	 @angular/router: 13.2.2
   	 @fortawesome/angular-fontawesome: 0.10.1
   	 @ngrx/effects: 13.0.2
   	 @ngrx/entity: 13.0.2
   	 @ngrx/router-store: 13.0.2
   	 @ngrx/store: 13.0.2
   	 @angular-devkit/architect: 0.1302.3
   	 @angular-devkit/build-angular: 13.2.3
   	 @angular/cli: 13.2.3
   	 @angular/compiler-cli: 13.2.2
   	 @angular/language-service: 13.2.2
   	 @ngrx/schematics: 13.0.2
   	 @ngrx/store-devtools: 13.0.2
@AgentEnder AgentEnder added scope: core core nx functionality scope: linter Issues related to Eslint support in Nx labels Mar 11, 2022
@meeroslav meeroslav added the blocked: retry with latest Retry with latest release or head. label Mar 14, 2022
@meeroslav
Copy link
Contributor

This should be fixed in 13.8.4 by this PR #9110.

Can you please retry with latest version?

@meeroslav meeroslav removed the scope: core core nx functionality label Mar 14, 2022
@meeroslav meeroslav self-assigned this Mar 14, 2022
@adrdilauro
Copy link
Author

Yes it seems to be fixed now. Thanks

@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 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked: retry with latest Retry with latest release or head. outdated scope: linter Issues related to Eslint support in Nx type: bug
Projects
None yet
Development

No branches or pull requests

3 participants