Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(no-extraneous-dependencies): add exclude option to rule#3198

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
sf0rman wants to merge2 commits intoimport-js:main
base:main
Choose a base branch
Loading
fromsf0rman:add-exclude-to-no-extraneous-dependencies

Conversation

sf0rman
Copy link

Encountered an issue when usingredux-ui and 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 anexclude option to theno-extraneous-dependencies rule.

@codecovCodecov
Copy link

codecovbot commentedJul 9, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.18%. Comparing base(01c9eb0) to head(369c265).

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.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@ljharbljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
if(!exclude){
returnfalse;
}
if(Array.isArray(exclude)){
returnexclude.some((pattern)=>minimatch(packageName,pattern));
}
returnminimatch(packageName,exclude);
return[].concat(exclude||[]).some((pattern)=>minimatch(packageName,pattern));

@@ -277,6 +292,7 @@ module.exports = {
packageDir: { type: ['string', 'array'] },
includeInternal: { type: ['boolean'] },
includeTypes: { type: ['boolean'] },
exclude: { type: ['string', 'array'] },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

for the array, let's ensure it's unique, and that the items can only be of type string

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ljharbljharbljharb requested changes

Requested changes must be addressed to merge this pull request.

Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@sf0rman@ljharb

[8]ページ先頭

©2009-2025 Movatter.jp