standard / atom-standardjs-snippets

:zap: A collection of JavaScript snippets for Atom, Standard Style

Home Page:http://standardjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a space before a function declaration's parentheses.

Kaijun opened this issue · comments

http://standardjs.com/rules.html

Add a space before a function declaration's parentheses.

function name (arg) { ... }   // ✓ ok 
function name(arg) { ... }    // ✗ avoid 
 
run(function () { ... })      // ✓ ok 
run(function() { ... })       // ✗ avoid 

Apparently this snippet doesn't follow this rule.

Any fixes?

ok, i would add space manually for now.

thanks @Kaijun. I updated the readme.
snippets were fine, code is here https://github.com/gaboesquivel/atom-standardjs-snippets/blob/master/snippets/functions.cson#L2

f⇥ anonymous function

function (${1:arguments}) { ${0} }

fn⇥ named function

function ${1:name} (${2:arguments}) {
  ${0}
}