Giter Site home page Giter Site logo

Comments (1)

md-durjoy avatar md-durjoy commented on June 6, 2024

To fix the issue with Prettier not formatting on save in Visual Studio Code, you can follow these steps:

Check Prettier Configuration:
Make sure your Prettier configuration is set up correctly. Ensure that you have a valid prettier.config.js or .prettierrc file in your project root directory with the desired formatting rules.

Verify VS Code Settings:
Open your VS Code settings (settings.json) and confirm that the "editor.formatOnSave" setting is enabled. You can enable it by adding or updating the following line in your settings:

json

"editor.formatOnSave": true

Check for Conflicting Extensions:
Disable any other formatting extensions you have installed in VS Code temporarily to see if they might be conflicting with Prettier. Sometimes, multiple formatting extensions can interfere with each other.

Verify Prettier Extension Settings:
Ensure that the Prettier extension is properly configured in VS Code. Open the extensions view (Ctrl+Shift+X), search for "Prettier - Code formatter", and click on the gear icon to access its settings. Make sure that the "Format On Save" option is enabled.

Restart VS Code:
After making changes to settings or extensions, it's a good idea to restart VS Code to ensure that the changes take effect.

Check Output Panel for Errors:
Open the VS Code output panel (View -> Output) and select "Prettier" from the dropdown. Look for any error messages or warnings related to Prettier. These messages might provide insights into what's going wrong.

Reinstall Prettier Extension:
If none of the above steps resolve the issue, you can try reinstalling the Prettier extension. You mentioned that you've already tried this, but it's worth another attempt.

Verify Path Configuration (if relevant):
If you suspect that there's a path issue related to Prettier, double-check that the path to the Prettier executable is correctly configured in your VS Code settings. You can set the path explicitly using the "prettier.prettierPath" setting in your VS Code settings.

from prettier-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.