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

243
Views
How to have Prettier format two JSX and JS separately within the same file in React

Is there any way to have Prettier format JavaScript differently than the JSX in React in the same file, mainly just making the tabWidth for JS 4 and for JSX 2?

Should I be changing the file extension to .jsx and not .js, or will this at least make it so that if I move all my components to be rendered entirely in their own file with props, I can call those .jsx files and it will format them with tabWidth 2 and then keep functions and other things in a separate JS file that will be formatted with tabWidth 4?

about 4 years ago · Juan Pablo Isaza
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!