-
-
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
Allow to require from internal project file with import/no-extraneous-dependencies
#2066
Comments
Seems related, yes. |
As I explain in the defect #2072, we're recursively searching for the 1st package.json in the @apollo/client/link/error path. |
The error I have is that's asking to install a package that its name is the full |
Is there any package.json under the folder node_modules/@apollo/client/link/error ? |
Surprissingly yes, I would bet it was not there before: {
"name": "@apollo/client/link/error",
"main": "error.cjs.js",
"module": "index.js",
"types": "index.d.ts",
"sideEffects": false
} It doesn't make any sense, I've reviewed other folders in the installed |
You have Apollo client code at https://github.com/apollographql/apollo-client, and link error at https://github.com/apollographql/apollo-client/tree/main/src/link/error. |
Try a fresh install then verify the folder. |
solution I propose in #2072 might resolve your problem. It's will be a little less strict on the imports but might be enough for these cases |
Ok understood. Preact/hook is a real package with a package.json. I think one fix can solve it and all other defects. If we found package a/b/c, no errors if in dependencies we've got 'a' or 'a/b' or 'a/b/c' @ljharb what do you think about ? |
|
I've created the PR #2097 for this. Can you look at it ? |
When importing or requireing an internal file instead of the raw project export,
import/no-extraneous-dependencies
fails. This is a valid use case, so for example requires to@apollo/client/link/error
should be successful if the@apollo/client
package is included inpackage.json
file, but right now it's failing since it checks for the full string.The text was updated successfully, but these errors were encountered: