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
Process files only supported by plugins #15433
Conversation
92832cc
to
9e05260
Compare
I've added tests for #15155 (comment) and #15155 (comment). I'll add more tests for #15155 (comment) and #15155 (comment) (?) tomorrow. |
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.
LGTM, more tests are good, but totally optional.
Lint is failing. |
src/cli/format.js
Outdated
for await (const pathOrError of expandPatterns(context)) { | ||
if (typeof pathOrError === "object") { | ||
context.logger.error(pathOrError.error); | ||
for await (const { error, fileName, ignoreUnknown } of expandPatterns( |
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.
Why rename filename
to fileName
? Filename is one word.
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.
Because expandPatterns
yields fileName
. But I don't have any opinion on this naming. So I'll fix it. Thanks.
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.
filename
is fine when use alone, but when use together with filePath
(I don't think filepath
it's a word) and fileUrl
, it's a little bit odd. So I use fileName
sometime.
I'm not a native English speaker, not sure what's the best.
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 I use lots of fileUrlOrPath
in recent PRs...
@@ -20,15 +20,15 @@ async function* expandPatterns(context) { | |||
continue; | |||
} | |||
|
|||
const fileName = path.resolve(filePath); | |||
const filename = path.resolve(filePath); |
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.
FYI: I'm waiting for fast-glob v4 to use absolute: true
. There are bugs in v3. mrmlnc/fast-glob#371 mrmlnc/fast-glob#379
@fisker What do you think about release this as a patch version? We should release this a minor? |
Minor should be better, since it's not a bug fix, we don't format them in v2 before, this become a problem only because we removed the plugin search feature. We don't add much new features recently. Maybe patch is fine too. I'll leave the decision to you. |
I'll release this as a minor ( |
Waiting for 3.1 release, to update my project dependencies |
Is there any ETA for the 3.1 release? We've been keeping the Svelte project templates on v2, but users have upgrading to v3 on their own and keep hitting this. I'd love to see this fix released |
Right now, prettier 3.0 doesn't correctly format astro files using the plugin. This will be fixed in 3.1 but it hasn't been released yet. If we upgrade it means that we don't have to specify **/*.astro in the invocation of prettier. withastro/prettier-plugin-astro#358 prettier/prettier#15079 prettier/prettier#15433
Yes, it will process every file but ignore files can't find a parser. |
We had to change our config file from https://github.com/firefox-devtools/profiler/blob/2c0cbe6023ac94e16df11748946c1cdbdb4f6e00%5E/.prettierrc.js |
Sorry about that. Glad you figured how to make it work 👍 |
Description
Implementation of #15155 (comment)
Closes #15155
Fixes #15079
This PR is based on #15155 and inherits the test files. The implementation has been completely changed based on the review from @fisker.
This updates the snapshots of some existing tests. I think this is fine, what do you think?
Checklist
docs/
directory).changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.✨Try the playground for this PR✨