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.

Latest version make HTML code and vue templates unreadable

See original GitHub issue

I have just updated prettier in VScode and now if makes aright old mess of html and vue.js template code.

Fort example it turns:

           <div class="columns report-title" id="report-title">
                <page-title title="Pre-Event Report" width="is-three-fifths" subtitle="View your pre-event attendance report."></page-title>
                <event-selector class="column has-text-right-tablet" v-if="eventListLoaded" />
            </div>

into

        <div
          class="columns report-title"
          id="report-title"
        >
          <page-title
            title="Pre-Event Report"
            width="is-three-fifths"
            subtitle="View your pre-event attendance report."
          ></page-title>
          <event-selector
            class="column has-text-right-tablet"
            v-if="eventListLoaded"
          />
        </div>

and one line of code like this:

<grid-item class="dash-panel" v-for="(item,index) in layout" :x="item.x" :y="item.y" :w="item.w" :h="item.h" :i="item.i" :minH="griditem.minH" :minW="griditem.minW" :maxH="griditem.maxH" :maxW="griditem.maxW" :key="index" :drag-allow-from="griditem.dragAllow">

into

          <grid-item
            class="dash-panel"
            v-for="(item,index) in layout"
            :x="item.x"
            :y="item.y"
            :w="item.w"
            :h="item.h"
            :i="item.i"
            :minH="griditem.minH"
            :minW="griditem.minW"
            :maxH="griditem.maxH"
            :maxW="griditem.maxW"
            :key="index"
            :drag-allow-from="griditem.dragAllow"
          >

Makes the code look a right old mess, makes it unreadable and doubles the length of my source files.

Not exactly progress. Is there any way to go back to an older version, as I have had to disable prettier from my vscode setup?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
events-jonas-chriswcommented, Dec 17, 2018

@events-jonas-chrisw Isn’t that formatting what’s recommended in the vue style guide?

yep, still doesn’t make it easy to read… those dangling closing tags freak out my OCD 😃

0reactions
phifacommented, Feb 13, 2019

"vetur.format.defaultFormatter.html": "prettyhtml"

This made it work for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue JS 3 Tutorial for Beginners #4 - The Vue CLI ... - YouTube
We'll talk about vue files, templates & template refs too. ... + Get VS Code - https:// code.visualstudio.com/ ‍ ‍ ...
Read more >
Template Syntax | Vue.js
All Vue templates are syntactically valid HTML that can be parsed by spec-compliant browsers and HTML parsers.
Read more >
7 Ways to Define a Component Template in Vue.js
There are plenty of choices when it comes to defining component templates in Vue. By my count, there are at least seven different...
Read more >
VSCode prettier/vue formatting settings don't work properly
I have tried changing word-wrap-length and prettier lengths and indentations, font size and appearance of the mini map...nothing seems to make ...
Read more >
Vue is specifically better because it uses HTML-based templates by ...
SSR/isometric rendering isn't new, but it's usually hacks around using a frontend JS framework to run the backend and can result in the...
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