import-js / import-js/eslint-plugin-import
declaring package in subfolder and the "should be listed in the project's dependencies" error
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported error with eslint-plugin-import, ESLint, and the nested src/package.json configuration described in the issue. Trace the rule that reports that src should be listed in the project's dependencies; done means the intended import is handled correctly or the supported configuration and limitation are documented, with a regression test if the project has one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100