Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

103
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!