question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(I removed the issue boilerplate because it doesn’t seem to pertain to feature requests — hope that’s okay.)

@vjeux sent me here! On the Svelte project, we’re often asked if it it’s possible to use Prettier to format single-file components. At present the answer is ‘no, not reliably’, because we typically write those components in .html files, and components are written in a superset of HTML called HTMLx.

Since Prettier supports Angular and Vue flavours of HTML already, I wondered what it would take to support HTMLx in addition? (We’re considering adopting and promoting an .htmlx extension similar to .vue, if that’s necessary.) We’d obviously be happy to do the work, I’m just raising this issue to see if a PR adding support would be likely to be accepted.

(Note that HTMLx will change slightly for Svelte 3, out soon.)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
jamesbirtlescommented, Feb 2, 2019

I’ve made prettier-plugin-svelte. Is it preferred that things are built in to prettier, or provided as plugins? I don’t know how hard it would be to integrate what I’ve done into prettier but willing to give it a go if I find some time

2reactions
suchipicommented, Nov 20, 2018

Assuming our HTML/Vue/Angular parser can already parse everything you need, add an entry for htmlx here and then adjust the printing to support htmlx-specific semantics in this file. The way the printer works is it returns an intermediate representation of the text called a “document” that is comprised of various nodes which are informally documented here. The logic here where we handle vue’s v-for attribute may be a good place to start.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML Reference Browser Support - W3Schools
HTML Reference With Browser Support. The table below lists all HTML elements and their attributes, along with browser support: ...
Read more >
"HTML" | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >
HTML5test - How well does your browser support HTML5?
HTML5 defines rules for embedding SVG and MathML inside a regular HTML document. The following tests only check if the browser is following...
Read more >
HTML Support - Product Documentation - Ivanti
HTML Support Through the CIE · Use Well-Formed HTML · Use Standard HTML · Specify the Correct Content Type · Construct URLs Using...
Read more >
HTML Programming with Visual Studio Code
VS Code also includes great Emmet support. IntelliSense. As you type in HTML, we offer suggestions via HTML IntelliSense. In the image below,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found