Support `.html.tpl` as HTML files
See original GitHub issueEnvironments:
- Prettier Version: 1.15.1
- Running Prettier via: CLI (in my case, but this affects all)
- Runtime: N/A
- Operating System: N/A
It is common to see .html.tpl
files being installed/used by build tools, and in most cases these are valid HTML files. Would it be reasonable to support this specific extension with the html
parser?
We are using the following configuration at the moment:
overrides: [
{
files: '*.html.tpl',
options: { parser: 'html' },
},
],
but it would be nice if Prettier was opinionatedly considering these as HTML by default. Thoughts?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Visual Studio Code: Treat other extensions as HTML
There is a setting files.associations that can be used to assign file patterns to languages. ... for example '.tpl': 'text/html'; save and restart...
Read more >Creating node templates - the tpl html files - Quanta CMS
Creating a template file. Creating a basic template for a node, is quite easy: just add a tpl.html file inside its related folder....
Read more >What is .tpl file in PHP web design? - GeeksforGeeks
TPL is a template file which is a common text file that contains user-defined variables that are entitled to be overridden by user-defined ......
Read more >Display .tpl files as simple html+php files
I'm using a cms where template files have .tpl extension, but they don't use any templating engine like Smarty, those are just simple......
Read more >Template Files .tpl versus .html files | SEO Forum - Moz
We sell a large selection of Insulation Products use template files (.tpl) to collect up-to-date information from a server side database file ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Through I does work with that example, it doesn’t mean this would work in all scenarios. Template languages are not supported yet by Prettier, but Angular’s and Vue’s.
If you are sure your files are HTML compatible, then use the workaround you proposed, but I don’t think is a good idea for this be the default behavior, as it could lead to unintended formatting.
All very good points. The first example I have should always be valid HTML so my workaround will work, and the second project is being rewritten in Vue so it’s not worth the effort until the rewrite is finished. I’m going to close this because it makes sense and I have a workaround. If someone is looking for something similar, this issue / arguments will now show up in the search results.
Thanks!