vscode-javascript
vscode-javascript copied to clipboard
How to remove the semicolon
How to remove the semicolon ?
Hi,
instead of removing semicolon I just set my VSC to autoFix linter issues on save:
"eslint.autoFixOnSave": true,
"eslint.validate": [
{
"language": "html",
"autoFix": true
},
{
"language": "vue",
"autoFix": true
},
{
"language": "javascript",
"autoFix": true
},
{
"language": "javascriptreact",
"autoFix": true
}
],
this way, semicolons are left alone or removed depending on my project's eslint configuration.
Hope it helps.
@afontcu thanks for the nice suggestion. I consider this as a nice solution.
As described in #16 I had to make a choice when created the snippets. At that point the majority of the people include the semicolons. Or at least this was my sense.
Now I see that this changes. So I might remove all semicolons in a future release if more people ask for it.
I love this extension but found myself hitting End
and Backspace
after using any snippets since I use the StandardJS style which enforces not using semicolons - I have published a fork of this with semicolons removed :sparkles: GitHub || Extension
Hi All, you may want to upvote https://github.com/Microsoft/vscode/issues/63534
semi
is the rule that governs semi colons be or not to be.
Since you ask to remove then:
"semi": [
"error",
"never"
]
I even added a note on the readme about the fork extension that doesn't include the semicolon.
Use https://github.com/jmsv/vscode-javascript-standard instead
Search VS Code settings or open ~/.config/Code/User/settings.json
and set "javascript.format.semicolons": "remove",
Then rightclick a JS file open in the editor and "Format Document With..." "TypeScript and JavaScript Language Features (default)" or simply press the assigned shortcut.
adding this "eslint.codeActionsOnSave.mode": "problems"
to settings.json did it for me.