Prettier can't differentiate classic HTML files from Django HTML templates
Summary
I can't prevent Prettier to run with Django HTML files, while I want to use it with "classic" HTML files only.
I don't want to use Prettier to format Django HTML files, because it can't do it and write error in logs if it tries to.
Both files have an .html extension and I guess Prettier uses this extension to lint or not.
However, VS Code itself is able to differentiate them after installing a specific extension that add django-html language:
Steps To Reproduce:
- in your settings: write:
"editor.formatOnSave": true,
"[html]": {"editor.defaultFormatter": "esbenp.prettier-vscode"},
"[django-html]": {"editor.defaultFormatter": null },
- install this extension
Expected result
When I save a Django HTML file, I expect Prettier not to be run.
Actual result
Prettier is run, and write an error in logs, since it's unable to parse Django tags.
A workaround that does the job:
"[django-html]": {
"editor.formatOnSave": false
},
However, I still don't understand why the initial code does not work.
This issue has been labeled as stale due to inactivity. Reply to keep this issue open.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.