-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
fix: don't ignore file extensions defined in .prettierrc overrides #111
Conversation
👋 Hey @bob-laz. Change looks good, let's get it shipped! 🚢 A couple of unit tests would be great. |
I wonder if the https://github.com/azz/pretty-quick/blob/master/src/createIgnorer.js It might be reading the ignore file twice the way you've done it. |
bae6e73
to
7269733
Compare
7269733
to
4d5637f
Compare
@azz updated the PR with your suggestion and a pretty basic unit test. Let me know if there's something else you'd like to see tested. I wasn't able to get it working to use this function instead of the createIgnorer. I did some testing and it didn't seem like paths specified in .prettierignore were returning |
That's because you need to set |
So it might actually be better to keep the ignore logic as it is, so we don't have to read and parse the ignore file for every file that is being checked. By not passing |
Could you add an option called Other than that this is good to ship! 🚢 |
Thanks for the review, I'll get these things added! |
alias: { | ||
'resolve-config': 'resolveConfig', | ||
}, | ||
}); |
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.
had to add an alias here otherwise when I passed no-resolve-config
it was only resolved as a variable named resolve-config
instead of resolveConfig
@@ -22,6 +22,7 @@ export default ( | |||
onExamineFile, | |||
onCheckFile, | |||
onWriteFile, | |||
resolveConfig = true, |
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.
You said to default this to false but from your wording it sounded like we wanted resolving the config to be the default behavior and if this is defaulted to false, I would have to negate it in isSupportedExtension.js
to determine whether or not to resolve the config, which seemed confusing
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.
Yep you got it right.
@azz I updated the readme and added the new config property! |
Thanks! |
🎉 This PR is included in version 3.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Related to: #108
Your suggestion to use the getFileInfo API appears to work, I am seeing file extensions I defined in
.prettierrc
having their formatting checked as expected.You were concerned about speed with this approach. I did some rough testing:
Before the change to getFileInfo:
After the change to getFileInfo:
Not the most thorough test but it doesn't look to be too concerning to me? Let me know if you'd like me to do additional testing.
I can add some unit tests for this as well, but wanted to check and see if the approach was alright with you before spending time there.