Skip to content

Instantly share code, notes, and snippets.

@paulserraino
Forked from pauloptimizely/javascript.json
Created September 30, 2018 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulserraino/4399d4ed073d7b06b234b611e8422566 to your computer and use it in GitHub Desktop.
Save paulserraino/4399d4ed073d7b06b234b611e8422566 to your computer and use it in GitHub Desktop.
VSCode User Snippets
{
"log": {
"prefix": "log",
"body": "console.log('${0}');",
"description": "Log output to console"
},
"import": {
"prefix": "impo",
"body": "import ${1} from '${2}';${0}",
"description": "Creates es6 import"
},
"require": {
"prefix": "req",
"body": "const ${1} = require('${2}');\n${0}",
"description": "Creates es6 require"
},
"constructor": {
"prefix": "con",
"body": "constructor(${1}) {\n\tsuper(${1});\n\t${0}\n}",
"description": "Add default constructor in a class in ES6 syntax"
},
"method": {
"prefix": "meth",
"body": "${1:methodName} = (${2:params}) => {\n\t${0}\n}",
"description": "Creates a method inside a class in ES6 syntax"
},
"propTypes": {
"prefix": "prop",
"body": "${1:prop}: PropTypes.${0},",
"description": "Creates a prop with propTypes"
},
"function": {
"prefix": "fu",
"body": "function ${1}(${2}){\n\t${0}\n}",
"description": "Creates a es5 function"
},
"describe": {
"prefix": "desc",
"body": "describe('${1}', function() {\n\t${0}\n});"
},
"it": {
"prefix": "it",
"body": "it('should ${1}');${0}",
"description": "Creates an it block."
},
"toBe": {
"prefix": "to",
"body": "expect(${1}).toBe(${0});",
"description": "Creates a toBe Jest assertion"
},
"toEqual": {
"prefix": "toe",
"body": "expect(${1}).toEqual(${0});",
"description": "Creates a toEqual Jest assertion"
},
"find": {
"prefix": "find",
"body": "component.find('${1}')${0}",
"description": "Creates a Enzyme find function"
},
"shallow": {
"prefix": "shal",
"body": "component = shallow(\n\t<${1:Component}\n\t\t${0:props}\n\t/>\n);"
},
"mount": {
"prefix": "mou",
"body": "component = mount(\n\t<${1:Component}\n\t\t${0:props}\n\t/>\n);"
},
}
{
"editor.renderWhitespace": "all",
"workbench.editor.tabSizing": "shrink",
"workbench.colorTheme": "Atom One Dark",
"editor.minimap.enabled": false,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"explorer.confirmDragAndDrop": false,
"editor.acceptSuggestionOnCommitCharacter": false,
"typescript.autoImportSuggestions.enabled": false,
"editor.snippetSuggestions": "top",
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
"emmet.triggerExpansionOnTab": true,
"editor.colorDecorators": false,
"files.insertFinalNewline": true,
"javascript.updateImportsOnFileMove.enabled": "never",
"window.nativeTabs": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment