Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

73
Views
After save Javascript file in VScode, it changed all format

I am having a problem with my vscode that I hope someone can help me. When I try to save a javascript file, it changed all the formating. So, I have to change the language mode from Javascript to Javascript React to all of .js files to make it looks normal. Do you have any suggestions?

Before saving

   const FormComponent = () => {
  return (
    <div className="container">
      <h1>Hello </h1>
    </div>
  );
};

export default FormComponent;

After saving

const FormComponent = () => {
    return ( <
        div className = "container" >
        <
        h1 > Hello < /h1> <
        /div>
    );
};

export default FormComponent;

in settings.json

  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": false
  },
7 months ago · Juan Pablo Isaza
1 answers
Answer question

0

You have set editor.formatOnSave to true

Change it to false as it formats the file on saving

7 months 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 job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.