feat(no-extraneous-dependencies): add exclude option to rule#3198
Open
sf0rman wants to merge 2 commits intoimport-js:mainfrom
Open
feat(no-extraneous-dependencies): add exclude option to rule#3198sf0rman wants to merge 2 commits intoimport-js:mainfrom
sf0rman wants to merge 2 commits intoimport-js:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3198 +/- ##
==========================================
+ Coverage 82.25% 92.18% +9.92%
==========================================
Files 94 83 -11
Lines 4283 3696 -587
Branches 1478 1334 -144
==========================================
- Hits 3523 3407 -116
+ Misses 760 289 -471 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ljharb
requested changes
Jul 10, 2025
Member
ljharb
left a comment
There was a problem hiding this comment.
I'm confused what you mean by "nested dependencies". If you're using @redux-ui/react-<component>, then it should be in your package.json, no?
Comment on lines
+181
to
+188
| if (!exclude) { | ||
| return false; | ||
| } | ||
|
|
||
| if (Array.isArray(exclude)) { | ||
| return exclude.some((pattern) => minimatch(packageName, pattern)); | ||
| } | ||
| return minimatch(packageName, exclude); |
Member
There was a problem hiding this comment.
Suggested change
| if (!exclude) { | |
| return false; | |
| } | |
| if (Array.isArray(exclude)) { | |
| return exclude.some((pattern) => minimatch(packageName, pattern)); | |
| } | |
| return minimatch(packageName, exclude); | |
| return [].concat(exclude || []).some((pattern) => minimatch(packageName, pattern)); |
| packageDir: { type: ['string', 'array'] }, | ||
| includeInternal: { type: ['boolean'] }, | ||
| includeTypes: { type: ['boolean'] }, | ||
| exclude: { type: ['string', 'array'] }, |
Member
There was a problem hiding this comment.
for the array, let's ensure it's unique, and that the items can only be of type string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Encountered an issue when using
redux-uiand importing the nested dependencies@redux-ui/react-<component>and wanted a way to exclude anything like@redux-ui/react-*without having to do it per line or per file which would have other side effects.Implemented an
excludeoption to theno-extraneous-dependenciesrule.