feat: add ignore option to extraneous deps#2039
feat: add ignore option to extraneous deps#2039Aghassi wants to merge 1 commit intoimport-js:mainfrom
Conversation
We are doing a migration with 1st party dependencies in a monorepo that requires this ability, otherwise we get false positives. This option allows the user to pass a regex so that if a package matches the regex it won't report as an offender.
ljharb
left a comment
There was a problem hiding this comment.
Can you elaborate on why this is needed?
| 'peerDependencies': { 'type': ['boolean', 'array'] }, | ||
| 'bundledDependencies': { 'type': ['boolean', 'array'] }, | ||
| 'packageDir': { 'type': ['string', 'array'] }, | ||
| 'ignore': { 'type': 'regexp' }, |
There was a problem hiding this comment.
it's a very bad idea to allow regex strings in eslint configs; that's how you get CVEs. this should be a glob string instead.
i'd also expect it to be allowed to be an array of glob strings.
There was a problem hiding this comment.
Thanks, that's a good idea!
|
Also, see #903. |
|
@ljharb Sure thing. We are migrating our codebase to bazel, and as an interim step for users we use a preinstall script to generate the bazel built versions of 1st party dependencies. We then specify the built artifacts as part of a |
|
I'm confused; bazel has workspaces support (using links). What oddities? |
I think we are crisscrossing the word Does that make sense? I'm probably doing a poor job of explaining it :/ |
|
I dropped a quick comment on a very common ecosystem use case that demonstrates the need for this feature here: #903 (comment) |
|
We solved this issue using https://github.com/import-js/eslint-plugin-import#importinternal-regex |
We are doing a migration with 1st party dependencies in a monorepo that requires this ability, otherwise we get false positives. This option allows the user to pass a regex so that if a package matches the regex it won't report as an offender.