question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enhancement: Allow no-extraneous-dependencies to check internal Imports

See original GitHub issue

In 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:23 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
bdwaincommented, Sep 2, 2022

Sounds good! I’ll work on this one first. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow no-extraneous-dependencies to check internal Imports ...
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...
Read more >
Why (and How Can I FIx) ESLint import/no-extraneous ...
If you arrived here while searching for 'Definition for rule 'import/no-extraneous-dependencies' was not found'.
Read more >
eslint-plugin-import | Yarn - Package Manager
This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names.
Read more >
eslint/eslint - Gitter
A globally-installed ESLint cannot find a locally-installed plugin. 2. ... (It should be prefixed, e.g. import/no-extraneous-dependencies ). riccardod.
Read more >
node_modules/eslint-plugin-import/CHANGELOG.md ... - GitLab
no -extraneous-dependencies : packageDir option with array value was ... order 's newlines-between option to allow newlines inside import groups (#627, #628, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found