Closed andershagbard closed 1 year ago
Yep that's a v3 breaking change from prettier unfortunately. I'm not happy with how they communicated it.
Try adding this to your .prettierrc.json
{
"plugins": ["@shopify/prettier-plugin-liquid"]
}
Already have it in my config.
{
"$schema": "https://json.schemastore.org/prettierrc.json",
"printWidth": 100,
"singleQuote": true,
"plugins": ["@shopify/prettier-plugin-liquid", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": ["**/*.liquid"],
"options": {
"singleQuote": false
}
}
]
}
I otherwise have no idea. Couldn't find a meaningful API change from their docs that says we should be doing something different on our end. Did they hardcode a default pattern in v3? Doesn't seem to be anything about that in the migration docs either...
Seems like a bug in Prettier. It semi-ignores my config file.
Running prettier using yarn prettier . --write --plugin="@shopify/prettier-plugin-liquid" --plugin="prettier-plugin-tailwindcss"
works as expected.
Confirmed bug in prettier. Progress can be followed in this issue: https://github.com/prettier/prettier/issues/15079
Just add this to settings.json in vscode:
{
"[liquid]": {
"editor.defaultFormatter": "Shopify.theme-check-vscode",
"editor.formatOnSave": true
},
}
This will also enable format on save.
Any solution ?
Any solution ?
Should be working now. Just update your packages
Describe the bug In Prettier v2, it was possible to just use
prettier .
, and it would run on on all files, including.liquid
files. In Prettier v3, you have to useprettier --write '**/*.liquid'
to make it run on.liquid
files.Debugging information