How to disable Prettier in VSCODE

Disable Prettier in VSCode: learn to edit configs & disable the format-on-save feature with an example!

Disabling Prettier in VSCODE

Prettier is a popular code formatting tool that helps developers write clean, consistent code. It can be enabled in Visual Studio Code (VSCode) with a few clicks, and makes it easier to keep your code organized and consistent across your team. However, there may come a time when you need to disable Prettier in VSCode. Here's how to do it:

First, open VSCode and go to File > Preferences > Settings. In the search bar, type in "prettier" to bring up the Prettier settings. Then, you can uncheck the "Format On Save" option. This will stop Prettier from automatically formatting your code every time you save a file.

You can also disable Prettier on specific files by adding the following line to the top of the file:

/* prettier-ignore */

This will tell Prettier to ignore this file, and it won't format it when you save it. If you want to re-enable Prettier for this file, simply remove the line.

Finally, if you want to completely disable Prettier for the entire project, you can add the following line to your project's .prettierrc file:

"disableLanguages": [ "*" ]

This will tell Prettier to ignore all files in the project, regardless of their type. Note that this will not disable Prettier in other projects, only the current one.

These are just a few of the ways you can disable Prettier in VSCode. Depending on how you want to use Prettier, you may find other methods that work better for your particular situation.

Answers (0)