diff options
Diffstat (limited to 'emacs.d/snippets/rjsx-mode')
-rw-r--r-- | emacs.d/snippets/rjsx-mode/console-log | 5 | ||||
-rw-r--r-- | emacs.d/snippets/rjsx-mode/const-defn | 5 | ||||
-rw-r--r-- | emacs.d/snippets/rjsx-mode/const-function | 7 | ||||
-rw-r--r-- | emacs.d/snippets/rjsx-mode/destructure-const | 5 | ||||
-rw-r--r-- | emacs.d/snippets/rjsx-mode/fat-arrow | 5 | ||||
-rw-r--r-- | emacs.d/snippets/rjsx-mode/fat-arrow-function | 7 | ||||
-rw-r--r-- | emacs.d/snippets/rjsx-mode/import-destructured | 5 | ||||
-rw-r--r-- | emacs.d/snippets/rjsx-mode/import-react | 5 | ||||
-rw-r--r-- | emacs.d/snippets/rjsx-mode/import-type | 5 | ||||
-rw-r--r-- | emacs.d/snippets/rjsx-mode/import-x-from-y | 5 | ||||
-rw-r--r-- | emacs.d/snippets/rjsx-mode/import-y | 5 | ||||
-rw-r--r-- | emacs.d/snippets/rjsx-mode/jest-describe-test | 10 | ||||
-rw-r--r-- | emacs.d/snippets/rjsx-mode/jest-test | 7 | ||||
-rw-r--r-- | emacs.d/snippets/rjsx-mode/react-class-component | 11 |
14 files changed, 87 insertions, 0 deletions
diff --git a/emacs.d/snippets/rjsx-mode/console-log b/emacs.d/snippets/rjsx-mode/console-log new file mode 100644 index 000000000000..bc51f8313301 --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/console-log @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Console.log helper +# key: clo +# -- +console.log($1) \ No newline at end of file diff --git a/emacs.d/snippets/rjsx-mode/const-defn b/emacs.d/snippets/rjsx-mode/const-defn new file mode 100644 index 000000000000..8e35e61fc2c4 --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/const-defn @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: const definition +# key: cn +# -- +const $1 = '$2' \ No newline at end of file diff --git a/emacs.d/snippets/rjsx-mode/const-function b/emacs.d/snippets/rjsx-mode/const-function new file mode 100644 index 000000000000..13f2018f2269 --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/const-function @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: const function +# key: cfn +# -- +const $1 = ($2) => { + $3 +} \ No newline at end of file diff --git a/emacs.d/snippets/rjsx-mode/destructure-const b/emacs.d/snippets/rjsx-mode/destructure-const new file mode 100644 index 000000000000..2a52c57c75cd --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/destructure-const @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Destructuring a const +# key: cds +# -- +const { $1 } = $2 \ No newline at end of file diff --git a/emacs.d/snippets/rjsx-mode/fat-arrow b/emacs.d/snippets/rjsx-mode/fat-arrow new file mode 100644 index 000000000000..187a2efc5a7c --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/fat-arrow @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Fat arrow function +# key: fa +# -- +=> \ No newline at end of file diff --git a/emacs.d/snippets/rjsx-mode/fat-arrow-function b/emacs.d/snippets/rjsx-mode/fat-arrow-function new file mode 100644 index 000000000000..694914a83c95 --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/fat-arrow-function @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Fat arrow function +# key: faf +# -- +() => { + $1 +} \ No newline at end of file diff --git a/emacs.d/snippets/rjsx-mode/import-destructured b/emacs.d/snippets/rjsx-mode/import-destructured new file mode 100644 index 000000000000..ded3ce163a93 --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/import-destructured @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Import destructured +# key: ids +# -- +import { $1 } from '$2' \ No newline at end of file diff --git a/emacs.d/snippets/rjsx-mode/import-react b/emacs.d/snippets/rjsx-mode/import-react new file mode 100644 index 000000000000..0463f5cd5593 --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/import-react @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Import React dependency (ES6) +# key: ir +# -- +import React from 'react' diff --git a/emacs.d/snippets/rjsx-mode/import-type b/emacs.d/snippets/rjsx-mode/import-type new file mode 100644 index 000000000000..fcd51f687b61 --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/import-type @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: import type +# key: ixt +# -- +import type { $1 } from '$2' \ No newline at end of file diff --git a/emacs.d/snippets/rjsx-mode/import-x-from-y b/emacs.d/snippets/rjsx-mode/import-x-from-y new file mode 100644 index 000000000000..09fa6df50506 --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/import-x-from-y @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: import x from y +# key: ix +# -- +import $1 from '$2' \ No newline at end of file diff --git a/emacs.d/snippets/rjsx-mode/import-y b/emacs.d/snippets/rjsx-mode/import-y new file mode 100644 index 000000000000..9f550e300d12 --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/import-y @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: import y +# key: iy +# -- +import '$1' \ No newline at end of file diff --git a/emacs.d/snippets/rjsx-mode/jest-describe-test b/emacs.d/snippets/rjsx-mode/jest-describe-test new file mode 100644 index 000000000000..ed382d4f74c4 --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/jest-describe-test @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: Jest describe/test block +# key: dsc +# -- +describe('$1', () => { + test('$2', () => { + + expect($3).toEqual($4) + }) +}) \ No newline at end of file diff --git a/emacs.d/snippets/rjsx-mode/jest-test b/emacs.d/snippets/rjsx-mode/jest-test new file mode 100644 index 000000000000..12ca2e786ded --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/jest-test @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Jest / Jasmine test +# key: tst +# -- +test('$1', () => { + expect($2).toBe($3) +}) \ No newline at end of file diff --git a/emacs.d/snippets/rjsx-mode/react-class-component b/emacs.d/snippets/rjsx-mode/react-class-component new file mode 100644 index 000000000000..f2a93a31d96d --- /dev/null +++ b/emacs.d/snippets/rjsx-mode/react-class-component @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: React class extends +# key: clz +# -- +class $1 extends React.Component { + render() { + $2 + } +} + +export default $1 \ No newline at end of file |