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

declaring package in subfolder and the "should be listed in the project's dependencies" error #904

Open
fnicastri opened this issue Jul 26, 2017 · 4 comments
Labels

Comments

@fnicastri
Copy link

fnicastri commented Jul 26, 2017

Hi,

I'm trying to configure eslint with the airbnb config for my react native project.
To have nicer import statements I've a package.json in my src folder in which i declare a new 'src' package so I can have import like:

import ExamForm from "src/containers/examFormContainer";

and not like:

import ExamForm from "../../../../containers/examFormContainer";

but can't find how configure eslint-plugin-import
to not throw the "src should be listed in the project's dependencies".
How I can configure it?

this is the sub folder's package.json file

{
    "name":"src",
    "version":"0.1.0"
}

Thanks,
Frank

@fnicastri
Copy link
Author

No one can help?

@bitcrumb
Copy link

+1

I would like to know how to deal with this situation as well?

@bitcrumb
Copy link

bitcrumb commented Aug 10, 2017

I've added the dependencies to my package.json under "dependencies" as follows:

  "api": "./src/api",
  "core": "./src/core",
  "common": "./src/common"

This will effectively create symlinks in your node_modules folder to the specified directories. And it will also resolve the warnings/errors you get.

@fnicastri
Copy link
Author

Thanks.
But I've disabled the check.
Maybe after this project I will try it.

Frank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants