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

105
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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