[Bug] `prettier . --write` does not run on .gjs/.gts files
Closed this issue ยท 9 comments
๐ 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
- prettier-plugin-ember-template-tag version: 1.0.2
- ember-template-imports version: -
โ 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 only prettier .
seems to ignore any .gjs/.gts files
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}"
๐
My changes: NullVoxPopuli/limber@80433f7#diff-fcf5729f4474308f357cea6ec1123607ce116df8a7a60516595fac5f5327e01bR33
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 prettier/prettier#15079
In the meantime add the plugin
flag as I mentioned above.
Supposedly this is fixed by prettier/prettier#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: prettier/prettier#15433 (comment)
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.