Skip to content

Commit 42e1edf

Browse files
authored
feat: add the required snippets in next-javascript.json file (#46)
1 parent cf135dd commit 42e1edf

File tree

2 files changed

+44
-8
lines changed

2 files changed

+44
-8
lines changed

packages/vscode/snippets/next-javascript.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
],
1111
"description": "JavaScript: Next.js get server side props"
1212
},
13-
1413
"ngsp": {
1514
"prefix": "ngsp",
1615
"body": [
@@ -45,7 +44,6 @@
4544
],
4645
"description": "JavaScript: Next.js custom app"
4746
},
48-
4947
"ncdoc": {
5048
"prefix": "ncdoc",
5149
"body": [
@@ -66,4 +64,4 @@
6664
],
6765
"description": "JavaScript: Next.js custom document"
6866
}
69-
}
67+
}

packages/vscode/snippets/react-typescript.json

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
11
{
2+
"rimr": {
3+
"prefix": "rimr",
4+
"body": [
5+
"import React from 'react';"
6+
],
7+
"description": "TypeScript: import react"
8+
},
9+
"rimrd": {
10+
"prefix": "rimrd",
11+
"body": [
12+
"import ReactDOM from 'react-dom';"
13+
],
14+
"description": "TypeScript: import React DOM"
15+
},
16+
"rimrs": {
17+
"prefix": "rimrs",
18+
"body": [
19+
"import React, { useState } from 'react';"
20+
],
21+
"description": "Typescript: Import React and useState"
22+
},
23+
"rimrse": {
24+
"prefix": "rimrse",
25+
"body": [
26+
"import React, { useState, useEffect} from 'react';"
27+
],
28+
"description": "Typescript: Import React, useState and useEffect"
29+
},
230
"rfct": {
331
"prefix": "rfct",
432
"body": [
@@ -16,22 +44,32 @@
1644
},
1745
"ruet": {
1846
"prefix": "ruet",
19-
"body": ["useEffect(() => {", "\t$1", "}, []);"],
47+
"body": [
48+
"useEffect(() => {",
49+
"\t$1",
50+
"}, []);"
51+
],
2052
"description": "TypeScript: useEffect hook"
2153
},
2254
"rust": {
2355
"prefix": "rust",
24-
"body": ["const [${1}, set${1}] = useState(${2});"],
56+
"body": [
57+
"const [${1}, set${1}] = useState(${2});"
58+
],
2559
"description": "TypeScript: useState hook"
2660
},
2761
"ruct": {
2862
"prefix": "ruct",
29-
"body": ["const ${1} = useContext(${2});"],
63+
"body": [
64+
"const ${1} = useContext(${2});"
65+
],
3066
"description": "TypeScript: useContext hook"
3167
},
3268
"rurt": {
3369
"prefix": "rurt",
34-
"body": ["const ${1} = useRef(${2});"],
70+
"body": [
71+
"const ${1} = useRef(${2});"
72+
],
3573
"description": "TypeScript: useRef hook"
3674
}
37-
}
75+
}

0 commit comments

Comments
 (0)