eslint-plugin-import
eslint-plugin-import copied to clipboard
declaring package in subfolder and the "should be listed in the project's dependencies" error
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
No one can help?
+1
I would like to know how to deal with this situation as well?
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.
Thanks. But I've disabled the check. Maybe after this project I will try it.
Frank