How to remove semicolons in prettier?

Viewed 64700

I am using the VS Code prettier plugin to format my code, how can I add a setting to not add or remove semicolons when I format my code? I know that this feature was added in January but I found no mention in the PR or issue of how to add it to settings.

3 Answers

Open settings.json file*.

Add this lines to format your code on save and to remove semicolons on save:

    "editor.formatOnSave": true,

    "prettier.semi": false,




Use Ctrl+P to search for file in Vs Code.*

In your Prettier settings. Add the following

semi: false
  • If you want to format your file using CLI, then
prettier --write --no-semi your_file 
Related