-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ignore option to extraneous deps #2039
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on why this is needed?
@@ -200,6 +204,7 @@ module.exports = { | |||
'peerDependencies': { 'type': ['boolean', 'array'] }, | |||
'bundledDependencies': { 'type': ['boolean', 'array'] }, | |||
'packageDir': { 'type': ['string', 'array'] }, | |||
'ignore': { 'type': 'regexp' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.