[import/no-extraneous-dependencies]: better support for monorepos
See original GitHub issueThis is a feature request
Its possible that this is just an issue in documentation as i didn’t dig to source code yet
packageDir
option should take into account yarn workspaces
or lerna projects
if present to ease usage of for large monorepo projects
this can be also achieved by allowing us to use regexp / glob to find roots
Context
i recently noticed that in some of projects that I’m using, has this rule configured incorrectly, user has to provide paths to all package.json configs even if he is working on monorepos
example of projects that can benefit from this change (big one that i worked on):
- https://github.com/typescript-eslint/typescript-eslint
- uses yarn workspaces and lerna projects
- https://github.com/babel/babel
- has lerna projects
- https://github.com/facebook/jest
- uses yarn workspaces and lerna projects
Note that all of those projects currently have invalid configuration for this rule,
unless i misread documentation and package.json
files are resolved relatively to parsed file
related comments/issues:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:16 (3 by maintainers)
Top GitHub Comments
yes it’s look like issue with monorepos has been solved.
from my tests this is working fine now on win/linux/mac machines,
https://github.com/conventional-changelog/commitlint/blob/75b67b8fb7fc4df21267b98f0c9daeeb1130b824/.eslintrc.js#L31-L36
A PR with failing test cases would be appreciated.