Enhancement: Allow no-extraneous-dependencies to check internal Imports
See original GitHub issueIn our monorepo I have setup that anything prefixed with out npm-scope is marked as internal, ie. ^@scope-.*/
. This is working really well for us.
We are now at a stage where we are going to need to publish some of our packages to be consumed in other projects/repos. Due to this I now wish to use no-extraneous-dependencies
to ensure that everyone is rembering to include this internal package references.
I did consider doing this by removing the internal regex, but this then effects the import sortinng (as we keep our internal deps grouped seperatly to our external deps - thanks to the order
rule)
What I would like to see is to add an option to no-extraneous-dependencies
to allow it to check internal imports based on a regex (either the internal regex or a newly defined on the rule config) as well as external.
I would be happy to work on a PR to add this option.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:23 (15 by maintainers)
Top GitHub Comments
Sounds good! I’ll work on this one first. Thanks
PR is up https://github.com/import-js/eslint-plugin-import/pull/2541