From df8d96b7194a59047b8f6c3fb9007cbd221027f0 Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Wed, 27 Sep 2017 16:39:08 -0700 Subject: [PATCH] Update javascript snippits for eslint rules --- vim/UltiSnips/javascript.snippets | 34 ++++++++++++++++--------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/vim/UltiSnips/javascript.snippets b/vim/UltiSnips/javascript.snippets index d34e18a..019b3b4 100644 --- a/vim/UltiSnips/javascript.snippets +++ b/vim/UltiSnips/javascript.snippets @@ -1,5 +1,5 @@ snippet f "function" ! -function ${1:function_name}(${2:argument}) { +function ${1:function_name} (${2:argument}) { ${VISUAL}$0 } endsnippet @@ -7,56 +7,58 @@ endsnippet snippet scf "self calling function" ! (function (${1:argument}) { ${VISUAL}$0 -}(${2:$1})); +}(${2:$1})) endsnippet snippet log "console.log" -console.log(${1:"${2:value}"}); +// eslint-disable-next-line no-console +console.log(${1:'${2:value}'}) endsnippet snippet strict "use strict" -'use strict'; +'use strict' endsnippet snippet timeout "setTimeout" ! setTimeout(function () { ${1://code} -}, 0); +}, 0) endsnippet snippet it "it test case" ! -it('→ $1', function () { -}); +it('→ $1', () => { +}) endsnippet snippet desc "describe test case" ! -describe('→ $1', function () { -}); +describe('→ $1', () => { +}) endsnippet snippet exp "expect" b -expect($1).toBe($2); +expect($1).toBe($2) endsnippet snippet umd "Universal Module Definition" b (function (root, factory) { if (typeof define === "function" && define.amd) { - define(["${1:dependency}"], factory); + define(["${1:dependency}"], factory) } else if (typeof exports === "object") { - module.exports = factory(require("$1")); + module.exports = factory(require("$1")) } else { - root.${2:Export} = factory(root.$1); + root.${2:Export} = factory(root.$1) } }(this, function ($1) { function $2($3) { } - return $2; -})); + return $2 +})) endsnippet + snippet debug "debugger" ! -/* eslint no-debugger: "off" */ +// eslint-disable-next-line no-debugger debugger$1 endsnippet