Last active
September 23, 2021 16:51
-
-
Save Cool-Runningz/53192bbc74bebd4183db49f2c8ecdbde to your computer and use it in GitHub Desktop.
VSCode Snippets - JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Console Log": { | |
"prefix": "cl", | |
"body": "console.log('$1')", | |
"description": "Inserts console.log('')" | |
}, | |
"Inserts a noop": { | |
"prefix": "noop", | |
"body": ["() => {}"], | |
"description": "Inserts a noop" | |
}, | |
"Inserts console.groupCollapsed('<label>')": { | |
"prefix": "cgc", | |
"body": [ | |
"console.groupCollapsed(\"$1\")", | |
"console.log(\"$2\")", | |
"console.groupEnd()" | |
], | |
"description": "Inserts console.groupCollapsed('<label>')" | |
}, | |
"Inserts console.table(data, [columns])": { | |
"prefix": "ct", | |
"body": ["console.table()"], | |
"description": "Inserts console.table(data, [columns])" | |
}, | |
"Arrow Function": { | |
"prefix": "arrow", | |
"body": ["const ${1:functionName} = ($2) => {", " $3", "}"], | |
"description": "Arrow Function" | |
}, | |
"Array Methods": { | |
"prefix": "arrm", | |
"body": [ | |
"${1|map,filter,indexOf,findIndex,forEach,reduce,some,find|}((${2:item}) => {", | |
" $3", | |
"})" | |
], | |
"description": "Array Methods" | |
}, | |
"useEffect": { | |
"prefix": "ueh", | |
"body": ["useEffect(() => {", "", "},[]);"], | |
"description": "Inserts useEffect hook stub" | |
}, | |
"useState": { | |
"prefix": "ush", | |
"body": "const [$1, set$2] = useState($3)", | |
"description": "Inserts useState hook stub" | |
}, | |
"iife": { | |
"prefix": "iife", | |
"body": ["((${1:arguments}) => {", "${0}", "})(${2});"], | |
"description": "Inserts iife stub" | |
}, | |
"useRef": { | |
"prefix": "urh", | |
"body": ["const $1Ref = useRef($2)"], | |
"description": "Inserts useRef hook stub" | |
}, | |
"Inserts console.dir()": { | |
"prefix": "cd", | |
"body": ["console.dir($1)"], | |
"description": "Inserts console.dir()" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment