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

104
Vistas
Configure Prettier to avoid replacing quotes

Background

I have tried several keywords but was not able to find a solution to disable prettier's quotes modification. I am working on a Polymer Lit project and I have tried a lot of things but it is really hard to maintain the code indentation ... So prettier does a very good job but only one problem which breaks my code.

Code Before Formatting

html`<div style="${'background-color: ' + this.bgColor }">
...
</div>`

Code After Formatting

html`<div style="${"background-color: " + this.bgColor}">...</div>`

Is there any flag / property I can pass to prettier to ignore or avoid the quotes and all the other things should work out ...

If there isn't can anyone tell me if there is any other Formater that does a clean job with lit element ..

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This is my .prettierrc for all my lit projects:

{
  "trailingComma": "es5",
  "tabWidth": 2,
  "singleQuote": true,
  "bracketSpacing": false,
  "arrowParens": "always"
}

And in markup I am using this (example):

<div class="wrapper ${this.animated ? 'active' : ''}" ${animate()}>

That works for me and never had any problems.

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