Closed ColdHeat closed 3 years ago
You can achieve this either by using the CLI option --parser
(e.g. prettier --parser melody '**/*.html'
, or prettier --parser melody '**/*.njk'
for Nunjucks, etc) or by defining an override in your Prettier config:
{
// ...
"prettier": {
// ...
"overrides": [
{
"files": "**/*.html",
"options": {
"parser": "melody"
}
}
]
}
}
I think this would be a useful prettier plugin for Jinja templates which also have a twig-like syntax.
Only issue is that Flask generally uses the .html extension for HTML files: https://github.com/pallets/flask/blob/38eb5d3b49d628785a470e2e773fc5ac82e3c8e4/src/flask/app.py#L803-L811.
Is it possible to get this plugin to override the prettier default HTML functionality?