Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

458
Visualizações
Remove Bracket Wrapping in Vue Files using Prettier VS Code

Prettier is wrapping attributes in my Vue components and putting the closing bracket on a new line like so:

<transition
    leave-active-class="transition duration-1000 ease-in"
    leave-class="opacity-100"
    leave-to-class="opacity-0"
>
    <div v-show="on" class="text-sm text-gray-600">
        <slot />
    </div>
</transition>

The wrapping of the attributes I like, but the bracket on a new line is unacceptable for our code. I know some Vue devs like it, but for my team it doesn't work.

In the VS Code settings I have

"prettier.jsxBracketSameLine": true

It seems that bracketSameLine was removed at some point.

I've seen other questions here with answers that mention that the extension comes with Vue disabled, and you should fix that by setting the disabledLanguages array. This setting has also been removed.

I'm seeing a Vue specific setting for the default formatter in the settings json:

"[vue]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
}

Is it possible to set something here that will stop this bracket wrapping, and if not what can I do to get this fixed?

MORE DISCOVERY:

It seems that the VS Code extension is not compatible with the latest version of Prettier.

Despite the documentation, options that are available in the extension are not compatible with Prettier 2.4.1 which is the version called for in it's package.json

For instance, Prettier 2.4.1 has deprecated jsxBracketSameLine in favor of bracketSameLine yet only the jsxBracketSameLine is available in the extension.

This is probably the reason the extension isn't working.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda