nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.27k stars 2.32k forks source link

Linting problem after migrating to 19.5.1 #27025

Closed phihochzwei closed 1 month ago

phihochzwei commented 2 months ago

Current Behavior

After migrating to 19.5.1 we cannot use the "unused-imports/no-unused-imports" rule anymore. It fails with the error

NX Cannot destructure property 'parent' of 'node' as it is undefined

Expected Behavior

The rule should work :)

GitHub Repo

No response

Steps to Reproduce

1.

Nx Report

NX   Report complete - copy this into the issue template

Node   : 22.2.0
OS     : darwin-arm64
npm    : 10.7.0

nx                 : 19.5.1
@nx/js             : 19.5.1
@nx/jest           : 19.5.1
@nx/linter         : 19.5.1
@nx/eslint         : 19.5.1
@nx/workspace      : 19.5.1
@nx/angular        : 19.5.1
@nx/cypress        : 19.5.1
@nx/devkit         : 19.5.1
@nx/eslint-plugin  : 19.5.1
@nx/nest           : 19.5.1
@nx/node           : 19.5.1
@nx/plugin         : 19.5.1
@nx/storybook      : 19.5.1
@nrwl/tao          : 19.5.1
@nx/web            : 19.5.1
@nx/webpack        : 19.5.1
typescript         : 5.5.3
---------------------------------------
Registered Plugins:
@nx/storybook/plugin
---------------------------------------
Community plugins:
@ngrx/component      : 18.0.1
@ngrx/effects        : 18.0.1
@ngrx/entity         : 18.0.1
@ngrx/router-store   : 18.0.1
@ngrx/schematics     : 18.0.1
@ngrx/store          : 18.0.1
@ngrx/store-devtools : 18.0.1
@storybook/angular   : 8.1.9
ng-mocks             : 14.13.0
---------------------------------------

Failure Logs

No response

Package Manager Version

No response

Operating System

Additional Information

No response

leosvelperez commented 1 month ago

It looks like you might be using an outdated version of the eslint-plugin-unused-imports. I was able to reproduce the issue when using version 1.x.x or 2.x.x of that package. If I use version 3 or 4, it works correctly.

Please update that package and you should get rid of the issue. If, after updating the package, you still face the same issue, please leave a message with more details to reproduce it, and I'll reopen this.

phihochzwei commented 1 month ago

We used 3.1 After updating to 3.2 it worked. Thank you

github-actions[bot] commented 3 weeks ago

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.