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.
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
note: These settings are prefixed with prettier.
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
config file. Add the following
semi: false
prettier --write --no-semi your_file
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.