我使用 VS 代码更漂亮的插件格式化我的代码,如何添加一个设置,不添加或删除分号时,我格式化我的代码?我知道这个功能是在一月份添加的,但我没有发现在公关或问题中提到如何添加到设置。
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)
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.
prettier.semi
false
To change prettier settings see,
Like all other vscode settings note: These settings are prefixed with prettier.
Like all other vscode settings
note: These settings are prefixed with prettier.
Open settings.json file*.
settings.json
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
Prettier
semi: false
prettier --write --no-semi your_file