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

Linting --with-deps does not work on Nx 12.8 #6922

Closed
ashwinGokhale opened this issue Sep 3, 2021 · 7 comments
Closed

Linting --with-deps does not work on Nx 12.8 #6922

ashwinGokhale opened this issue Sep 3, 2021 · 7 comments

Comments

@ashwinGokhale
Copy link
Contributor

Current Behavior

Linting a project and all its dependencies does not work.

Expected Behavior

Linting a project and all its dependencies should work. I believe this is a regression. Even if --with-deps is deprecated, it should still work until Nx 14.

Steps to Reproduce

  1. Clone nx-examples repo
  2. Run yarn
  3. yarn nx lint cart --with-deps

This issue may not be prioritized if details are not provided to help us reproduce the issue.

Failure Logs

$ nx lint cart --with-deps

DEPRECATION WARNING: --with-deps is deprecated and it will be removed in v14.
Configure target dependencies instead: https://nx.dev/latest/angular/core-concepts/configuration#target-dependencies.


>  NX  Running target lint for project cart and 8 task(s) that it depends on.


———————————————————————————————————————————————

> nx run shared-jsxify:lint

Linting "shared-jsxify"...

All files pass linting.


> nx run shared-product-types:lint

Linting "shared-product-types"...

All files pass linting.

Unexpected error:
TypeError: Cannot read property 'tags' of undefined
    at C:\Users\agokhale\source\nx-examples\node_modules\@nrwl\linter\src\executors\eslint\hasher.js:16:75
    at Array.map (<anonymous>)
    at C:\Users\agokhale\source\nx-examples\node_modules\@nrwl\linter\src\executors\eslint\hasher.js:16:44
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\agokhale\source\nx-examples\node_modules\tslib\tslib.js:114:62)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Environment

  Node : 14.16.1
  OS   : win32 x64
  yarn : 1.22.5

  nx : Not Found
  @nrwl/angular : 12.8.0
  @nrwl/cli : 12.8.0
  @nrwl/cypress : 12.8.0
  @nrwl/devkit : 12.8.0
  @nrwl/eslint-plugin-nx : 12.8.0
  @nrwl/express : Not Found
  @nrwl/jest : 12.8.0
  @nrwl/linter : 12.8.0
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/nx-cloud : 12.3.10
  @nrwl/react : 12.8.0
  @nrwl/schematics : Not Found
  @nrwl/tao : 12.8.0
  @nrwl/web : 12.8.0
  @nrwl/workspace : 12.8.0
  @nrwl/storybook : 12.8.0
  @nrwl/gatsby : Not Found
  typescript : 4.3.5
@leosvelperez
Copy link
Member

Thanks for reporting this!

This is a duplicate of #6760. Please note a fix has been merged in #6875 and it will be released soon, keep an eye on the releases.

@maxisam
Copy link

maxisam commented Oct 6, 2021

Does anyone know why --with-deps is deprecated? I don't see any other way to do it like --with-deps

@nelsond6
Copy link

@maxisam Its being deprecated because now you can define targetDependencies. You can read more about it at https://nx.dev/l/r/core-concepts/configuration and under the Target Dependencies section.

@maxisam
Copy link

maxisam commented Oct 19, 2021

@nelsond6 The funny thing is I use the targetDependencies way, and it still throws the same error. I am on 12.10.0

Node : 14.18.1
OS : linux x64
yarn : 1.22.15

nx : 12.10.0
@nrwl/angular : 12.10.0
@nrwl/cli : 12.10.0
@nrwl/cypress : 12.10.0
@nrwl/devkit : 12.10.0
@nrwl/eslint-plugin-nx : 12.10.0
@nrwl/express : Not Found
@nrwl/jest : 12.10.0
@nrwl/linter : 12.10.0
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : 12.5.0
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 12.10.0
@nrwl/web : 12.10.0
@nrwl/workspace : 12.10.0
@nrwl/storybook : 12.10.0
@nrwl/gatsby : Not Found
typescript : 4.3.5

@nelsond6
Copy link

@maxisam - yeah it did the same for me. Both --with-deps or using targetDependencies ends up in the same error. The good news is this is fixed in NX 13!

@pranav-js
Copy link

I still get this error with https://github.com/ionic-team/stencil-eslint extension with stencil-library setup in nx. Had to install with --legacy-peer-deps option though because it used lower version of eslint.

Now I get

Invalid lint configuration. Nothing to lint. Please check your lint target pattern(s).
Error: Invalid lint configuration. Nothing to lint. Please check your lint target pattern(s).
    at /Users/pranav.sarda/Documents/GitHub/zwitch-frontend/packages/linter/src/executors/eslint/lint.impl.ts:98:11
    at Generator.next (<anonymous>)
    at fulfilled (/Users/pranav.sarda/Documents/GitHub/zwitch-frontend/node_modules/tslib/tslib.js:114:62)

@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 23, 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

5 participants