|
2 | 2 | //#region //*=========== React =========== |
3 | 3 | "import React": { |
4 | 4 | "prefix": "ir", |
5 | | - "body": ["import * as React from 'react';"] |
| 5 | + "body": ["import * as React from 'react';"], |
6 | 6 | }, |
7 | 7 | "React.useState": { |
8 | 8 | "prefix": "us", |
9 | 9 | "body": [ |
10 | | - "const [${1}, set${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}] = React.useState<$3>(${2:initial${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}})$0" |
11 | | - ] |
| 10 | + "const [${1}, set${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}] = React.useState<$3>(${2:initial${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}})$0", |
| 11 | + ], |
12 | 12 | }, |
13 | 13 | "React.useEffect": { |
14 | 14 | "prefix": "uf", |
15 | | - "body": ["React.useEffect(() => {", " $0", "}, []);"] |
| 15 | + "body": ["React.useEffect(() => {", " $0", "}, []);"], |
16 | 16 | }, |
17 | 17 | "React.useReducer": { |
18 | 18 | "prefix": "ur", |
19 | 19 | "body": [ |
20 | 20 | "const [state, dispatch] = React.useReducer(${0:someReducer}, {", |
21 | 21 | " ", |
22 | | - "})" |
23 | | - ] |
| 22 | + "})", |
| 23 | + ], |
24 | 24 | }, |
25 | 25 | "React.useRef": { |
26 | 26 | "prefix": "urf", |
27 | | - "body": ["const ${1:someRef} = React.useRef($0)"] |
| 27 | + "body": ["const ${1:someRef} = React.useRef($0)"], |
28 | 28 | }, |
29 | 29 | "React Functional Component": { |
30 | 30 | "prefix": "rc", |
|
36 | 36 | " $0", |
37 | 37 | " </div>", |
38 | 38 | " )", |
39 | | - "}" |
40 | | - ] |
| 39 | + "}", |
| 40 | + ], |
41 | 41 | }, |
42 | 42 | "React Functional Component with Props": { |
43 | 43 | "prefix": "rcp", |
|
52 | 52 | " $0", |
53 | 53 | " </div>", |
54 | 54 | " )", |
55 | | - "}" |
56 | | - ] |
| 55 | + "}", |
| 56 | + ], |
57 | 57 | }, |
58 | 58 | //#endregion //*======== React =========== |
59 | 59 |
|
|
64 | 64 | "body": [ |
65 | 65 | "//#region //*=========== ${1} ===========", |
66 | 66 | "${TM_SELECTED_TEXT}$0", |
67 | | - "//#endregion //*======== ${1} ===========" |
68 | | - ] |
| 67 | + "//#endregion //*======== ${1} ===========", |
| 68 | + ], |
69 | 69 | }, |
70 | 70 | "Region CSS": { |
71 | 71 | "prefix": "regc", |
72 | 72 | "scope": "css, scss", |
73 | 73 | "body": [ |
74 | 74 | "/* #region /**=========== ${1} =========== */", |
75 | 75 | "${TM_SELECTED_TEXT}$0", |
76 | | - "/* #endregion /**======== ${1} =========== */" |
77 | | - ] |
| 76 | + "/* #endregion /**======== ${1} =========== */", |
| 77 | + ], |
78 | 78 | }, |
79 | 79 | //#endregion //*======== Commons =========== |
80 | 80 |
|
|
98 | 98 | " </main>", |
99 | 99 | " </Layout>", |
100 | 100 | " )", |
101 | | - "}" |
102 | | - ] |
| 101 | + "}", |
| 102 | + ], |
103 | 103 | }, |
104 | 104 | "Next API": { |
105 | 105 | "prefix": "napi", |
|
111 | 111 | " } else {", |
112 | 112 | " res.status(405).json({ message: 'Method Not Allowed' });", |
113 | 113 | " }", |
114 | | - "}" |
115 | | - ] |
| 114 | + "}", |
| 115 | + ], |
116 | 116 | }, |
117 | 117 | "Get Static Props": { |
118 | 118 | "prefix": "gsp", |
|
121 | 121 | " return {", |
122 | 122 | " props: {}", |
123 | 123 | " };", |
124 | | - "}" |
125 | | - ] |
| 124 | + "}", |
| 125 | + ], |
126 | 126 | }, |
127 | 127 | "Get Static Paths": { |
128 | 128 | "prefix": "gspa", |
|
134 | 134 | " ],", |
135 | 135 | " fallback: ", |
136 | 136 | " };", |
137 | | - "}" |
138 | | - ] |
| 137 | + "}", |
| 138 | + ], |
139 | 139 | }, |
140 | 140 | "Get Server Side Props": { |
141 | 141 | "prefix": "gssp", |
|
144 | 144 | " return {", |
145 | 145 | " props: {}", |
146 | 146 | " };", |
147 | | - "}" |
148 | | - ] |
| 147 | + "}", |
| 148 | + ], |
149 | 149 | }, |
150 | 150 | "Infer Get Static Props": { |
151 | 151 | "prefix": "igsp", |
152 | | - "body": "InferGetStaticPropsType<typeof getStaticProps>" |
| 152 | + "body": "InferGetStaticPropsType<typeof getStaticProps>", |
153 | 153 | }, |
154 | 154 | "Infer Get Server Side Props": { |
155 | 155 | "prefix": "igssp", |
156 | | - "body": "InferGetServerSidePropsType<typeof getServerSideProps>" |
| 156 | + "body": "InferGetServerSidePropsType<typeof getServerSideProps>", |
157 | 157 | }, |
158 | 158 | "Import useRouter": { |
159 | 159 | "prefix": "imust", |
160 | | - "body": ["import { useRouter } from 'next/router';"] |
| 160 | + "body": ["import { useRouter } from 'next/router';"], |
161 | 161 | }, |
162 | 162 | "Import Next Image": { |
163 | 163 | "prefix": "imimg", |
164 | | - "body": ["import Image from 'next/image';"] |
| 164 | + "body": ["import Image from 'next/image';"], |
165 | 165 | }, |
166 | 166 | "Import Next Link": { |
167 | 167 | "prefix": "iml", |
168 | | - "body": ["import Link from 'next/link';"] |
| 168 | + "body": ["import Link from 'next/link';"], |
169 | 169 | }, |
170 | 170 | //#endregion //*======== Next.js =========== |
171 | 171 |
|
172 | 172 | //#region //*=========== Snippet Wrap =========== |
173 | 173 | "Wrap with Fragment": { |
174 | 174 | "prefix": "ff", |
175 | | - "body": ["<>", "\t${TM_SELECTED_TEXT}", "</>"] |
| 175 | + "body": ["<>", "\t${TM_SELECTED_TEXT}", "</>"], |
176 | 176 | }, |
177 | 177 | "Wrap with clsx": { |
178 | 178 | "prefix": "cx", |
179 | | - "body": ["{clsx([${TM_SELECTED_TEXT}$0])}"] |
| 179 | + "body": ["{clsx([${TM_SELECTED_TEXT}$0])}"], |
180 | 180 | }, |
181 | 181 | "Wrap with clsxm": { |
182 | 182 | "prefix": "cxm", |
183 | | - "body": ["{clsxm([${TM_SELECTED_TEXT}$0, className])}"] |
| 183 | + "body": ["{clsxm([${TM_SELECTED_TEXT}$0, className])}"], |
184 | 184 | }, |
185 | 185 | //#endregion //*======== Snippet Wrap =========== |
186 | 186 |
|
187 | 187 | "Logger": { |
188 | 188 | "prefix": "lg", |
189 | 189 | "body": [ |
190 | | - "logger({ ${1:${CLIPBOARD}} }, '${TM_FILENAME} line ${TM_LINE_NUMBER}')" |
191 | | - ] |
192 | | - } |
| 190 | + "logger({ ${1:${CLIPBOARD}} }, '${TM_FILENAME} line ${TM_LINE_NUMBER}')", |
| 191 | + ], |
| 192 | + }, |
193 | 193 | } |
0 commit comments