How to remove semicolons in prettier?

47,429

Solution 1

From the readme:

prettier.semi (default: true)

Whether to add a semicolon at the end of every line (semi: true), or only at the beginning of lines that may introduce ASI failures (semi: false)

You have to set prettier.semi to false.

To change prettier settings see,

Like all other vscode settings enter image description here

note: These settings are prefixed with prettier.

Solution 2

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.*

Share:
47,429
Achyut Rastogi
Author by

Achyut Rastogi

BY Day I am a student, and by night I am still a student, I don't know how to do any magical transformations yet! I am on my way to becoming an open-source contributor and my favourite language is Python. For pass time I wander on stack overflow reading answers, watch animé, read about latest trends in open-source, play games and some competitive coding in C++ all about in equal portions. Trying to add open source to the mix!

Updated on July 08, 2022

Comments

  • Achyut Rastogi
    Achyut Rastogi almost 2 years

    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.