Skip to content
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

docs: fix & enhance "Use your own globs" example #912

Merged
merged 1 commit into from Sep 14, 2020

Conversation

SachinShekhar
Copy link
Contributor

@SachinShekhar SachinShekhar commented Sep 13, 2020

Fix: micromatch treats path strings differently, so *.js matches only those js files which are in drive's root, given the config function gets array of absolute paths as parameter. This PR fixes that.

Enhance: This PR also adds more clarification to the example by showing how multiple commands can be executed on different types of staged files.

@codecov
Copy link

codecov bot commented Sep 13, 2020

Codecov Report

Merging #912 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #912   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines          602       602           
  Branches       142       142           
=========================================
  Hits           602       602           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d404d7d...9303564. Read the comment docs.

@iiroj
Copy link
Member

iiroj commented Sep 14, 2020

@SachinShekhar are you sure about this? We specifically use the matchBase option like so:

https://github.com/okonet/lint-staged/blob/d404d7d5a2ccfba51d2d59e1fbb6e2e82539646c/lib/generateTasks.js#L46-L49

This is also documented in the README:

https://github.com/okonet/lint-staged#filtering-files

@SachinShekhar
Copy link
Contributor Author

@iiroj You answered yourself. Currently, the example doesn't use matchBase option either. So, a pattern without slash matches nothing.

@iiroj
Copy link
Member

iiroj commented Sep 14, 2020

Now I understood, you mean the micromatch commands in the example, not lint-staged itself! Looks good.

@iiroj iiroj merged commit 643038d into lint-staged:master Sep 14, 2020
@github-actions
Copy link
Contributor

🎉 This PR is included in version 10.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants