Closed simonihmig closed 10 months ago
I've reproduced this issue, and found that it does work when specifying a file, like npx prettier --write app/components/my-component.gjs
, but doesn't work with directories, like npx prettier --write app/components
.
My prettier command is now:
prettier -c "**/*.{js,gjs,cjs,mjs,json,hbs,ts,cts,mts,gts}"
:sweat_smile:
Sorry for the annoying bug. :-(
Based on Prettier's documentation, prettier --write .
should be working, but it seems like we actually need to do prettier --write --plugin prettier-plugin-ember-template-tag
. I am finding other plugins using this hack too but no one seems to mention it's a hack?
I will update the documentation accordingly and open an issue on prettier
.
Looks like this bug was introduced in prettier v3 and there is a fix in the works. More info at https://github.com/prettier/prettier/issues/15079
In the meantime add the plugin
flag as I mentioned above.
Supposedly this is fixed by https://github.com/prettier/prettier/pull/15433 but I haven't tried it yet. LMK if it works!
it does not, I still have this issue :(
ah, it's not released yet: https://github.com/prettier/prettier/pull/15433#issuecomment-1732958073
Like @NullVoxPopuli commented on discord, prettier@3.1 has been released this WE 🎉
README updated. I will re-open this if it's still borked.
🐞 Describe the Bug
prettier . --write
does not run on .gjs/.gts files🔬 Minimal Reproduction
I run
prettier . --write
😕 Actual Behavior
It reformats all files, except for .gjs/.gts files. CLI output list all kind of files, like .js/.cjs/.mjs, but no .gjs/.gts
🤔 Expected Behavior
Should reformat .gjs/.gts files.
🌍 Environment
➕ Additional Context
When I run
prettier path/to/component.gts --write
then it does work! Also running prettier using VSCode does work correctly. So it seem onlyprettier .
seems to ignore any .gjs/.gts files