Skip to content

Commit 288c696

Browse files
committed
feat: update JSON.stringify snippet
1 parent 1d52d32 commit 288c696

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

snippets/javascript.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,15 @@
166166
"scope": "javascript,javascriptreact"
167167
},
168168
"🟨 jsonStringify": {
169-
"prefix": "JSON.$JSON.jstr",
169+
"prefix": "jstr.$jstr.JSON",
170170
"body": [
171171
"JSON.stringify(${2:data}${1:, null, 2})"
172172
],
173173
"description": "JSON.stringify",
174174
"scope": "javascript,javascriptreact"
175175
},
176176
"🟨 jsonParse": {
177-
"prefix": "JSON.$JSON.jprs",
177+
"prefix": "jprs.$jprs.JSON",
178178
"body": [
179179
"JSON.parse(${1:data})"
180180
],
@@ -1353,15 +1353,15 @@
13531353
"scope": "javascript,javascriptreact"
13541354
},
13551355
"🟨 wrapWithJsonStringify": {
1356-
"prefix": "_jstr.$_jstr",
1356+
"prefix": "_jstr.$_jstr.JSON",
13571357
"body": [
1358-
"JSON.stringify($TM_SELECTED_TEXT)"
1358+
"JSON.stringify($TM_SELECTED_TEXT${1:, null, 2})"
13591359
],
13601360
"description": "Wrap with `JSON.stringify`",
13611361
"scope": "javascript,javascriptreact"
13621362
},
13631363
"🟨 wrapWithJsonParse": {
1364-
"prefix": "_jprs.$_jprs",
1364+
"prefix": "_jprs.$_jprs.JSON",
13651365
"body": [
13661366
"JSON.parse($TM_SELECTED_TEXT)"
13671367
],

snippets/typescript.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,15 @@
166166
"scope": "javascript,typescript,javascriptreact,typescriptreact"
167167
},
168168
"🟨 jsonStringify": {
169-
"prefix": "JSON.$JSON.jstr",
169+
"prefix": "jstr.$jstr.JSON",
170170
"body": [
171171
"JSON.stringify(${2:data}${1:, null, 2})"
172172
],
173173
"description": "JSON.stringify",
174174
"scope": "javascript,typescript,javascriptreact,typescriptreact"
175175
},
176176
"🟨 jsonParse": {
177-
"prefix": "JSON.$JSON.jprs",
177+
"prefix": "jprs.$jprs.JSON",
178178
"body": [
179179
"JSON.parse(${1:data})"
180180
],
@@ -1669,15 +1669,15 @@
16691669
"scope": "javascript,typescript,javascriptreact,typescriptreact"
16701670
},
16711671
"🟨 wrapWithJsonStringify": {
1672-
"prefix": "_jstr.$_jstr",
1672+
"prefix": "_jstr.$_jstr.JSON",
16731673
"body": [
1674-
"JSON.stringify($TM_SELECTED_TEXT)"
1674+
"JSON.stringify($TM_SELECTED_TEXT${1:, null, 2})"
16751675
],
16761676
"description": "Wrap with `JSON.stringify`",
16771677
"scope": "javascript,typescript,javascriptreact,typescriptreact"
16781678
},
16791679
"🟨 wrapWithJsonParse": {
1680-
"prefix": "_jprs.$_jprs",
1680+
"prefix": "_jprs.$_jprs.JSON",
16811681
"body": [
16821682
"JSON.parse($TM_SELECTED_TEXT)"
16831683
],

src/snippets/vanilla.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ export const asyncArrowFunctionExport: Snippet = {
115115
};
116116

117117
export const jsonStringify: Snippet = {
118-
prefix: ['JSON', 'jstr'],
118+
prefix: ['jstr', 'JSON'],
119119
body: ['JSON.stringify(${2:data}${1:, null, 2})'],
120120
description: 'JSON.stringify',
121121
};
122122

123123
export const jsonParse: Snippet = {
124-
prefix: ['JSON', 'jprs'],
124+
prefix: ['jprs', 'JSON'],
125125
body: ['JSON.parse(${1:data})'],
126126
description: 'JSON.parse',
127127
};

src/snippets/wrapper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ export const reactConditionalWithFragment: Snippet = {
7777
};
7878

7979
export const wrapWithJsonStringify: Snippet = {
80-
prefix: '_jstr',
81-
body: ['JSON.stringify($TM_SELECTED_TEXT)'],
80+
prefix: ['_jstr', 'JSON'],
81+
body: ['JSON.stringify($TM_SELECTED_TEXT${1:, null, 2})'],
8282
description: 'Wrap with `JSON.stringify`',
8383
};
8484

8585
export const wrapWithJsonParse: Snippet = {
86-
prefix: '_jprs',
86+
prefix: ['_jprs', 'JSON'],
8787
body: ['JSON.parse($TM_SELECTED_TEXT)'],
8888
description: 'Wrap with `JSON.parse`',
8989
};

0 commit comments

Comments
 (0)