-
-
Notifications
You must be signed in to change notification settings - Fork 425
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 ability to use function as config #913
Conversation
Codecov Report
@@ Coverage Diff @@
## master #913 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 17 18 +1
Lines 602 608 +6
Branches 142 143 +1
=========================================
+ Hits 602 608 +6
Continue to review full report at Codecov.
|
Thanks for the PR! I wonder if the |
|
Good enough for me! Do you think there are some existing examples In the readme that could use this format instead of the start glob? |
There was one example and I have already added the new alternative (but, didn't remove existing one because that remains valid). Do you want me to remove that existing example? |
Let's leave it, since it shows the explicit |
I think the readme could be more clear that you can either export a single function that receives all matched files, or then an object of globs, where each key can be a function (that receives only those matches), string or array of strings. Otherwise it's good to go IMO! |
Done. |
Thoughts, @okonet? |
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 LGTM but please consider documentation comments.
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.
I wrote some direct suggestions on the README text. What do you think?
Co-authored-by: Iiro Jäppinen <[email protected]>
43cd672
to
9a8d245
Compare
🎉 This PR is included in version 10.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR adds an ability to use a function as config. This function will get an array of all staged files as parameter which can be used with own globs. Currently, we need to pass such function as value of
'*'
in config object which doesn't feel good.This can be further optimized by not using
micromatch
internally when a function config is detected.