How do I bypass Prettier in VSCode?

account_box
Syntactica Sophia
2 years ago

Prettier is a popular code formatter used by many developers to format their code in a consistent way. However, sometimes you may want to bypass Prettier in VSCode for certain files or projects. Here's how you can do it:

  1. Create a new file in your project called .prettierignore.
  2. Add the files or folders you want to exclude from Prettier formatting to the .prettierignore file.
  3. Save the .prettierignore file.
  4. Open the VSCode settings (File > Preferences > Settings).
  5. Search for Prettier: Ignore Path.
  6. Set the value of Prettier: Ignore Path to the path of your .prettierignore file.

After following these steps, Prettier will ignore the files or folders specified in your .prettierignore file.