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 support for glob patterns like prettier (#57) #59
Conversation
f2a9da9
to
132584f
Compare
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.
Love it. Thanks! Would you be able to document this in README?
Would you like to be added as a collaborator on this project? |
132584f
to
6866f17
Compare
Yeah sure 👍 I did three changes:
|
src/createMatcher.js
Outdated
const path = require('path'); | ||
|
||
export default pattern => { | ||
if (typeof pattern !== 'string') { |
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'd have to double check, but if you do pretty-quick --pattern a --pattern b
, does mri
make pattern
equal ['a', 'b']
?
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.
(and if so, should we handle it?)
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 think we should either (a) handle multiple patterns or (b) print a warning rather than ignoring multiple patterns. I have no strong feelings one way or the other :P
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 also don't mind keeping the multimatch
dependency.
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’ll take a look and let you know :)
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 supports now three cases (using multimatch)
- no patterns
- 1 pattern (string)
- n pattern (array of strings)
6866f17
to
4445098
Compare
4445098
to
ea42bac
Compare
@azz do you think we can merge this now? |
This pull request adds the ability to filter files for a given minimatch pattern.
If no pattern is given it will work the same way it did before.
From: https://prettier.io/docs/en/cli.html
Fixes #57