vscode-javascript icon indicating copy to clipboard operation
vscode-javascript copied to clipboard

How to remove the semicolon

Open sschang opened this issue 7 years ago • 9 comments

How to remove the semicolon ?

sschang avatar Aug 01 '17 05:08 sschang

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 avatar Aug 21 '17 09:08 afontcu

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

xabikos avatar Sep 26 '17 16:09 xabikos

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

jmsv avatar Nov 21 '18 16:11 jmsv

Hi All, you may want to upvote https://github.com/Microsoft/vscode/issues/63534

antmdvs avatar Nov 21 '18 16:11 antmdvs

semi is the rule that governs semi colons be or not to be. Since you ask to remove then:

        "semi": [
            "error",
            "never"
        ]

wojjas avatar Dec 19 '18 13:12 wojjas

I even added a note on the readme about the fork extension that doesn't include the semicolon.

xabikos avatar Dec 24 '18 13:12 xabikos

Use https://github.com/jmsv/vscode-javascript-standard instead

franciscolourenco avatar Mar 28 '19 17:03 franciscolourenco

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.

CTimmerman avatar Jan 10 '20 15:01 CTimmerman

adding this "eslint.codeActionsOnSave.mode": "problems" to settings.json did it for me.

AshakaE avatar Nov 12 '21 20:11 AshakaE