about summary refs log tree commit diff
path: root/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-12-13T22·51+0300
committerVincent Ambo <mail@tazj.in>2021-12-13T23·15+0300
commit019f8fd2113df4c5247c3969c60fd4f0e08f91f7 (patch)
tree76a857f61aa88f62a30e854651e8439db77fd0ea /users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode
parent464bbcb15c09813172c79820bcf526bb10cf4208 (diff)
parent6123e976928ca3d8d93f0b2006b10b5f659eb74d (diff)
subtree(users/wpcarro): docking briefcase at '24f5a642' r/3226
git-subtree-dir: users/wpcarro
git-subtree-mainline: 464bbcb15c09813172c79820bcf526bb10cf4208
git-subtree-split: 24f5a642af3aa1627bbff977f0a101907a02c69f
Change-Id: I6105b3762b79126b3488359c95978cadb3efa789
Diffstat (limited to 'users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode')
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/.yas-parents1
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/action-extractor5
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/console-log5
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/const-defn5
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/const-function7
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/destructure-const5
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow5
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow-function7
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-destructured5
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-react5
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-type5
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-x-from-y5
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-y5
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/jest-describe-test10
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/jest-test7
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/react-class-component11
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/redux-action5
-rw-r--r--users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/typed-redux-action5
18 files changed, 103 insertions, 0 deletions
diff --git a/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/.yas-parents b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/.yas-parents
new file mode 100644
index 000000000000..d58dacb7a0b1
--- /dev/null
+++ b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/.yas-parents
@@ -0,0 +1 @@
+text-mode
\ No newline at end of file
diff --git a/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/action-extractor b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/action-extractor
new file mode 100644
index 000000000000..62834a29ab04
--- /dev/null
+++ b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/action-extractor
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: exactness
+# key: $x
+# --
+$Exact<$Call<typeof $1>>
\ No newline at end of file
diff --git a/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/console-log b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/console-log
new file mode 100644
index 000000000000..82ec3fd8e379
--- /dev/null
+++ b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/console-log
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: Console.log helper
+# key: clg
+# --
+console.log($1)
\ No newline at end of file
diff --git a/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/const-defn b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/const-defn
new file mode 100644
index 000000000000..8e35e61fc2c4
--- /dev/null
+++ b/users/wpcarro/emacs/.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/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/const-function b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/const-function
new file mode 100644
index 000000000000..13f2018f2269
--- /dev/null
+++ b/users/wpcarro/emacs/.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/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/destructure-const b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/destructure-const
new file mode 100644
index 000000000000..2a52c57c75cd
--- /dev/null
+++ b/users/wpcarro/emacs/.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/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow
new file mode 100644
index 000000000000..187a2efc5a7c
--- /dev/null
+++ b/users/wpcarro/emacs/.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/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow-function b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/fat-arrow-function
new file mode 100644
index 000000000000..694914a83c95
--- /dev/null
+++ b/users/wpcarro/emacs/.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/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-destructured b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-destructured
new file mode 100644
index 000000000000..ded3ce163a93
--- /dev/null
+++ b/users/wpcarro/emacs/.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/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-react b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-react
new file mode 100644
index 000000000000..0463f5cd5593
--- /dev/null
+++ b/users/wpcarro/emacs/.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/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-type b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-type
new file mode 100644
index 000000000000..fcd51f687b61
--- /dev/null
+++ b/users/wpcarro/emacs/.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/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-x-from-y b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-x-from-y
new file mode 100644
index 000000000000..09fa6df50506
--- /dev/null
+++ b/users/wpcarro/emacs/.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/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-y b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/import-y
new file mode 100644
index 000000000000..9f550e300d12
--- /dev/null
+++ b/users/wpcarro/emacs/.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/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/jest-describe-test b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/jest-describe-test
new file mode 100644
index 000000000000..ed382d4f74c4
--- /dev/null
+++ b/users/wpcarro/emacs/.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/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/jest-test b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/jest-test
new file mode 100644
index 000000000000..12ca2e786ded
--- /dev/null
+++ b/users/wpcarro/emacs/.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/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/react-class-component b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/react-class-component
new file mode 100644
index 000000000000..f2a93a31d96d
--- /dev/null
+++ b/users/wpcarro/emacs/.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
diff --git a/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/redux-action b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/redux-action
new file mode 100644
index 000000000000..681c5d0dfdf4
--- /dev/null
+++ b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/redux-action
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: redux-action
+# key: rax
+# --
+export const ${1:$$(string-lower->caps yas-text)} = '`(downcase (functions-buffer-dirname))`/${1:$(string-caps->kebab yas-text)}'
\ No newline at end of file
diff --git a/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/typed-redux-action b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/typed-redux-action
new file mode 100644
index 000000000000..53c6e5fc5ac2
--- /dev/null
+++ b/users/wpcarro/emacs/.emacs.d/snippets/rjsx-mode/typed-redux-action
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: typed-redux-action
+# key: trax
+# --
+export const ${1:$$(string-lower->caps yas-text)}: '`(downcase (functions-buffer-dirname))`/${1:$(string-caps->kebab yas-text)}' = '`(downcase (buffer-dirname))`/${1:$(string-caps->kebab yas-text)}'
\ No newline at end of file