Vetur: Html attributes in templates no longer wrap

Created on 1 Nov 2017  路  4Comments  路  Source: vuejs/vetur

Info

  • Platform: macOS
  • Vetur version: 0.10.1
  • VS Code version: 1.17.2 (1.17.2)

Problem

Before (some other version of vetur) the attributes wrapped as below:

                                    <widget-list :model="page"
                                        :active-image="activeImage"
                                        :active-file="activeFile"
                                        model-name="App\Page"
                                        v-model="widgets.data"
                                        :block-types="selectedPagetype.blockTemplates.data"
                                        :widgets="widgets.data"></widget-list>

In this version it becomes as below when formatting (cmd+b)

<widget-list :model="page" :active-image="activeImage" :active-file="activeFile" model-name="App\Page" v-model="widgets.data" :block-types="selectedPagetype.blockTemplates.data" :widgets="widgets.data"></widget-list>

I've configured vetur to use "js-beautify-html"

"vetur.format.defaultFormatter.html": "js-beautify-html",

But this seem to ignore my .jsbeautifyrc

Where did the old formatter go?

question

Most helpful comment

@see311 try this.

"vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            "wrap_attributes": "force-aligned"
        }
    }

All 4 comments

Settings for js-beautify https://vuejs.github.io/vetur/formatting.html#js-beautify-html

@octref thanks, and sorry for not checking the docs

@nivv How to set wrapping html attr? sorry, I still not undetstand

@see311 try this.

"vetur.format.defaultFormatterOptions": {
        "js-beautify-html": {
            "wrap_attributes": "force-aligned"
        }
    }
Was this page helpful?
0 / 5 - 0 ratings