Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
Prevent Prettier formating arrow functions to multiple lines

When I write arrow functions in Vue.js using vscode i get an unexpected formating.

I wish to change the settings for Prettier when auto formating arrow functions in vscode.

Expected:

<input type="file" @change="(event) => { files = event.target.files; }" accept=".csv" />

Acceptable:

<input 
    type="file"
    @change="(event) => {files = event.target.files;}"
    accept=".csv" 
/>

Actual:

<input
    type="file"
    @change="
        (event) => {
            files = event.target.files;
        }
    "
    accept=".csv"
/>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I did some research and found this feature has already been requested: https://github.com/prettier/prettier/issues/4125

Changes to prettier were made (https://github.com/prettier/prettier/pull/6685) and released in prettier 2.0 back in 2020. (https://prettier.io/blog/2020/03/21/2.0.0.html#improved-method-chain-breaking-heuristic-6685httpsgithubcomprettierprettierpull6685-by-mmkalhttpsgithubcommmkal)

But looking at example you provided it is still not working great apparently :/

If it were any option in prettier to configure this behaviour it would've been in here: https://prettier.io/docs/en/options.html But I haven't found anything that would help your case.

It seems to me the only thing you can do right now is to use

<!-- prettier-ignore -->

..before your line. You can read more about prettier ignore in html here: https://prettier.io/docs/en/ignore.html#html

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda