-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Split error with eslint-plugin-import #2120
Comments
Same here, with an import like this:
Downgrading to 2.23.3 fixes it. Seems like the issue may be related to this commit. da8d584 |
Just to confirm - is the dependency being imported actually installed? |
Yes, in my case, I am using typescript, and I have In VSCode, edit: I should clarify I have these dependencies both listed as devDependencies. This is a component library and I have all the dependencies listed in devDependencies. |
This comment has been minimized.
This comment has been minimized.
Hm - I wonder if the issue here is that the typescript resolver is resolving, for example, |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm trying to reproduce it without success. |
I can add a NPE to avoid the crash on split part in case of |
here is the PR: #2121 |
@paztis Can I provide you with more info? |
PS: I can back @uturnr as downgrading to 2.23.3 fixes it. |
If you can add a log in the no-extraneous-dependenxies.js file at line 186 |
@SoleneChiche, @uturnr can you try my changes directly inside the code of eslint-plugin-import inside your node_modules ? replace this with this If it works correctly it means this PR will resolve the issue and we can merge it / deliver a 2.23.5 |
We’d still need a regression test, so we’ll still need to be able to reproduce it. |
@paztis It works for me with the above change. And the console logs you previously requested:
resolved: realPackageName: |
readPkgUp.sync isn't able to find your package.json |
@paztis, hmm, this is strange. However there is an empty |
Better understand this problem now. We need to inspect the package.jsob to lookup on parents level of it didn't fit to the real package |
I will try to do it this evening |
I created a repro repo https://github.com/ertrzyiks/extraneous-dependencies-demo In this case it happens because material-ui provides incomplete package json for subfolders. package.json example:
|
after looking the content of @material-ui/core and mapbox-gl, I notice all the intermediate package.json have no name field. |
Correct fix now (and unit test) done in #2121 |
…te package.json lacks a name Fixes import-js#2120.
Hey, I'm also experiencing this - going to float the patch in the meantime. Just sharing in case you need help isolating this issue though it looks like Paztis already has a grip on the issue. |
Hi. Fix is done in PR #2121. |
(I was more saying that I am able to help with reproducing/debugging if that's needed - I'm fine with waiting for the fix a few weeks I'm in no rush - but thanks!) |
I can confirm that this can be reproduced by this also
|
…te package.json lacks a name Fixes import-js#2120.
…te package.json lacks a name Fixes import-js#2120.
I ran into this exact same error today when I was running NextJS's new this is how I calculate packageDir in my const {sync} = require('glob');
// ... rest of config
'import/no-extraneous-dependencies': [
'error',
{
packageDir: ['.', ...sync(`./packages/*`)],
},
], |
Hi all,
I'm trying by any mean to add to CRA v4 the airbnb config. It seems it is calling
eslint-plugin-import
(v2.23.4) and I run into this error:What seems to trigger this is the following lines from
theme.ts
:import { Styles } from '@material-ui/styles/withStyles'
Which seems valid to me...
Here is my config:
Important to know :
Any help is welcome!
Thanks
The text was updated successfully, but these errors were encountered: