-
-
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
[New] no-extraneous-dependencies
: Add considerInParents
option
#2481
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportBase: 95.27% // Head: 95.23% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2481 +/- ##
==========================================
- Coverage 95.27% 95.23% -0.05%
==========================================
Files 68 66 -2
Lines 2944 2793 -151
Branches 998 940 -58
==========================================
- Hits 2805 2660 -145
+ Misses 139 133 -6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
no-extranious-dependencies
: Support package.json files in parent foldersno-extraneous-dependencies
: Support package.json files in parent folders
FYI, I have seen these comments (thanks! good points). Hopefully I'll have time within the next week or two to address them. |
c65ed54
to
61eddb2
Compare
no-extraneous-dependencies
: Support package.json files in parent foldersno-extraneous-dependencies
: Add considerInParents
option
Sorry for the delay! Rewrote this with your feedback and it is significantly simpler. :) As a bonus, this should also improve caching, since it's no longer necessary to touch the file system to look for the closest package.json. Let me know if there's anything further I can improve! |
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.
Looks great!
Resolved all the feedback - let me know if you want me to squash. |
What is the status of this PR? |
Waiting for rereview as far as I'm concerned |
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.
This looks great! Sorry for the long review delay.
My comments are about converting the internal considerInParents
to a Set for perf. It'd also be nice to add more tests such that all of the dependency types are covered.
Interesting idea to use set. I'd be interested to see that benchmarked given the small sizes and additional spread when creating the cache key, though I wouldn't immediately know how to do that myself. :) I can certainly add a few more tests. |
yeah lol for such a small array it probably doesn't matter, but might as well use the proper data structure :-p |
@ljharb Can you help me understand why two of the tests I added are failing? It looks like this rule is trying to |
55f1c71
to
62bfc20
Compare
Hmm, no, I don't know why it's failing :-/ i just rebased it so results are fresh. |
Are there any updates on this? I would really love this feature, since it prevents specifying lots of workspaces in the eslintrc file to work around nesting |
@florian-bitgrip if you'd like to help, please comment with a link to a rebased branch with test failures fixed (NOT a new PR) and I'll pull the changes into here. |
Resolves #1913
I am not particularly happy with the implementation (in particular, the error passing and "requireExact" handling to match the current behavior feel misplaced and/or mishandled), but it's at the point that I feel it would be useful to get feedback (both on how the options are handled and the implementation).