Glavin001 / atom-beautify

:mega: Help Wanted - Looking for Maintainer: https://github.com/Glavin001/atom-beautify/issues/2572 | :lipstick: Universal beautification package for Atom editor (:warning: Currently migrating to https://github.com/Unibeautify/ and have very limited bandwidth for Atom-Beautify Issues. Thank you for your patience and understanding :heart: )
http://unibeautify.com/
MIT License
1.5k stars 453 forks source link

[Vue Beautifier] Add option to let it indent first child in .vue files' <template> section #1659

Closed lbssousa closed 6 years ago

lbssousa commented 7 years ago

I'm working on a Vue.js project with some coworkers, where some of us use Atom (with atom-beautify package) and the other ones use Visual Studio Code (with Vetur extension). I'm trying to fit my project's extensions/settings so that I can get the same formatting rules for both editors, but I simply can't make them indent <template> sections the same way. VSCode/Vetur treats this section as an ordinary HTML code, indenting it as usual:

<template>
  <div> <-- indented as usual
    (...)
  </div>
</template>

On the oher hand, atom-beautify seems to treat the very first <template> tag in .vue files specially, not indenting its first child:

<template>
<div> <-- NOT indented
  (...) <-- indented as usual
</div>
</template>

Would it be possible to add an option to Vue Beautifier allowing it to indent <template>'s first child as the first example above shows, so that I can format code consistently in either Atom or VSCode?

By the way, I've just opened another issue for the converse behaviour in VSCode: https://github.com/octref/vetur/issues/198

lqzhgood commented 7 years ago

I think <template><script> 、'