Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unnecessary semicolon using Sublime Text 3 autocomplete for JavaScript if-statement

I am using sublime text 3 autocompletion for JavaScript.

For if-statement, it added a semicolon at the end.

if (true) {};

Using JSHint, it gives me an error for most of my code written.

I would like to ask how to customise this autocompletion as my preference?

like image 518
Victor Leung Avatar asked Nov 19 '14 05:11

Victor Leung


1 Answers

Open the Sublime Text Folder by going to PreferencesBrowse Packages.

Then find the folder called JavaScript

Then open if.sublime-snippet and delete the semi-colon so your snippet now looks like this:

<snippet>
    <content><![CDATA[if (${1:true}) {${0:$TM_SELECTED_TEXT}}]]></content>
    <tabTrigger>if</tabTrigger>
    <scope>source.js</scope>
    <description>if</description>
</snippet>
like image 73
wesbos Avatar answered Nov 04 '22 16:11

wesbos