Update javascript snippits for eslint rules

Buddy Sandidge 7 years ago
parent bed29e95cc
commit df8d96b719

@ -7,56 +7,58 @@ endsnippet
snippet scf "self calling function" ! snippet scf "self calling function" !
(function (${1:argument}) { (function (${1:argument}) {
${VISUAL}$0 ${VISUAL}$0
}(${2:$1})); }(${2:$1}))
endsnippet endsnippet
snippet log "console.log" snippet log "console.log"
console.log(${1:"${2:value}"}); // eslint-disable-next-line no-console
console.log(${1:'${2:value}'})
endsnippet endsnippet
snippet strict "use strict" snippet strict "use strict"
'use strict'; 'use strict'
endsnippet endsnippet
snippet timeout "setTimeout" ! snippet timeout "setTimeout" !
setTimeout(function () { setTimeout(function () {
${1://code} ${1://code}
}, 0); }, 0)
endsnippet endsnippet
snippet it "it test case" ! snippet it "it test case" !
it('→ $1', function () { it('→ $1', () => {
}); })
endsnippet endsnippet
snippet desc "describe test case" ! snippet desc "describe test case" !
describe('→ $1', function () { describe('→ $1', () => {
}); })
endsnippet endsnippet
snippet exp "expect" b snippet exp "expect" b
expect($1).toBe($2); expect($1).toBe($2)
endsnippet endsnippet
snippet umd "Universal Module Definition" b snippet umd "Universal Module Definition" b
(function (root, factory) { (function (root, factory) {
if (typeof define === "function" && define.amd) { if (typeof define === "function" && define.amd) {
define(["${1:dependency}"], factory); define(["${1:dependency}"], factory)
} else if (typeof exports === "object") { } else if (typeof exports === "object") {
module.exports = factory(require("$1")); module.exports = factory(require("$1"))
} else { } else {
root.${2:Export} = factory(root.$1); root.${2:Export} = factory(root.$1)
} }
}(this, function ($1) { }(this, function ($1) {
function $2($3) { function $2($3) {
} }
return $2; return $2
})); }))
endsnippet endsnippet
snippet debug "debugger" ! snippet debug "debugger" !
/* eslint no-debugger: "off" */ // eslint-disable-next-line no-debugger
debugger$1 debugger$1
endsnippet endsnippet

Loading…
Cancel
Save