Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5e72d91

Browse files
committed
refactor: Reduce newline, avoid conflict or meaningful prefix.
- Remove newline for `switch` and case. - Rename `case` to `cas`, avoid meaningful. - Rename `ctor` to `cst`, avoid conflict to built-in. - Rename `require` to `re` avoid meaningful.
1 parent bf55bb7 commit 5e72d91

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

‎README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ Install from VSCode Extension Marketplace [Hyper JavaScript Snippets](https://ma
4141
| `cad` | const destructuring assignment (ES2015) | `const ${0:dest} = ${1}` |
4242

4343
### Conditional
44-
| Prefix | Desc | Body |
45-
| -----: | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
46-
| `if` | if statement | `if (${1}) ${0}` |
47-
| `el` | else statement | `else ${0}` |
48-
| `ifel` | if/else statement | `if (${1}) ${2} else ${0}` |
49-
| `elif` | else if statement | `else if (${1}) ${0}` |
50-
| `ter` | ternary operator | `${1} ? ${2} : ${0}` |
51-
| `sw` | switch case | <code>switch (${1}) {<br>&nbsp;&nbsp;case ${2} :<br>&nbsp;&nbsp;&nbsp;&nbsp;0ドル<br>&nbsp;&nbsp;default:<br>&nbsp;&nbsp;&nbsp;&nbsp;break;<br>}</code> |
52-
| `case` | switch's case | <code>case ${1} :<br>&nbsp;&nbsp;${0}</code> |
44+
| Prefix | Desc | Body |
45+
| -----: | ----------------- | ---------------------------------------------------------------------------------------------- |
46+
| `if` | if statement | `if (${1}) ${0}` |
47+
| `el` | else statement | `else ${0}` |
48+
| `ifel` | if/else statement | `if (${1}) ${2} else ${0}` |
49+
| `elif` | else if statement | `else if (${1}) ${0}` |
50+
| `ter` | ternary operator | `${1} ? ${2} : ${0}` |
51+
| `sw` | switch case | <code>switch (${1}) {<br>&nbsp;&nbsp;case ${2} : ${3}<br>&nbsp;&nbsp;default: ${0}<br>}</code> |
52+
| `case` | switch's case | <code>case ${1} :${0}</code> |
5353

5454
### Statement
5555
| Prefix | Desc | Body |
@@ -90,7 +90,7 @@ Install from VSCode Extension Marketplace [Hyper JavaScript Snippets](https://ma
9090
| -----: | -------------------------- | ------------------------------------------------------------------------------- |
9191
| `cs` | class (ES2015) | <code>class ${1:name} {<br>&nbsp;&nbsp;${0}<br>}</code> |
9292
| `cse` | class extends (ES2015) | <code>class ${1:name} extends ${2:base} {<br>&nbsp;&nbsp;${0}<br>}</code> |
93-
| `ctor` | class constructor (ES2015) | `constructor(${1}) {${0}}` |
93+
| `cst` | class constructor (ES2015) | `constructor(${1}) {${0}}` |
9494
| `csm` | method (ES2015) | `${1:name}(${2}) {${0}}` |
9595
| `csma` | async method (ES2015) | `async ${1:name}(${2}) {${0}}` |
9696
| `gter` | getter (ES2015) | `get ${1:property}() {${0}}` |
@@ -125,14 +125,14 @@ Install from VSCode Extension Marketplace [Hyper JavaScript Snippets](https://ma
125125
| `impas` | import module as (ES2015) | `import ${2:*} as ${3:name} from '${1}';${0}` |
126126

127127
### Node.js
128-
| Prefix | Desc | Body |
129-
| --------: | ---------------------- | ---------------------------------------- |
130-
| `cb` | Node.js style callback | `(err, ${1:response}) => {${0}}` |
131-
| `require` | require | `require(${1:path})${0}` |
132-
| `req` | require assignment | `const ${2:name} = require('${1}');${0}` |
133-
| `em` | exports.member | `exports.${1} = ${2};${0}` |
134-
| `me` | module.exports | `module.exports = ${1}${0}` |
135-
| `on` | event handler | `on('${1:event}', ${2:callback});${0}` |
128+
| Prefix | Desc | Body |
129+
| -----: | ---------------------- | ---------------------------------------- |
130+
| `cb` | Node.js style callback | `(err, ${1:response}) => {${0}}` |
131+
| `re` | require | `require(${1:path})${0}` |
132+
| `req` | require assignment | `const ${2:name} = require('${1}');${0}` |
133+
| `em` | exports.member | `exports.${1} = ${2};${0}` |
134+
| `me` | module.exports | `module.exports = ${1}${0}` |
135+
| `on` | event handler | `on('${1:event}', ${2:callback});${0}` |
136136

137137
### Console
138138
| Prefix | Desc | Body |

‎snippets/javascript.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
},
4747
"switch case": {
4848
"prefix": "sw",
49-
"body": "switch (${1}) {\n\tcase ${2} :\n\t\t0ドル\n\tdefault:\n\t\tbreak;\n}"
49+
"body": "switch (${1}) {\n\tcase ${2} :0ドル\n\tdefault: ${0}\n}"
5050
},
5151
"case": {
52-
"prefix": "case",
53-
"body": "case ${1} :\n\t${0}"
52+
"prefix": "cas",
53+
"body": "case ${1} :${0}"
5454
},
5555

5656
"for loop": {
@@ -134,7 +134,7 @@
134134
"body": "class ${1} extends ${2:base} {\n\t${0}\n}"
135135
},
136136
"class constructor (ES2015)": {
137-
"prefix": "ctor",
137+
"prefix": "cst",
138138
"body": "constructor(${1}) {${0}}"
139139
},
140140
"method (ES2015)": {
@@ -222,7 +222,7 @@
222222
"body": "(err, ${1:response}) => {${0}}"
223223
},
224224
"require (Node.JS)": {
225-
"prefix": "require",
225+
"prefix": "re",
226226
"body": "require(${1:path})${0}"
227227
},
228228
"require assignment (Node.JS)": {

‎snippets/typescript.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
},
4747
"switch case": {
4848
"prefix": "sw",
49-
"body": "switch (${1}) {\n\tcase ${2} :\n\t\t0ドル\n\tdefault:\n\t\tbreak;\n}"
49+
"body": "switch (${1}) {\n\tcase ${2} :0ドル\n\tdefault: ${0}\n}"
5050
},
5151
"case": {
52-
"prefix": "case",
53-
"body": "case ${1} :\n\t${0}"
52+
"prefix": "cas",
53+
"body": "case ${1} :${0}"
5454
},
5555

5656
"for loop": {
@@ -138,7 +138,7 @@
138138
"body": "class ${1} extends ${2:base} {\n\t${0}\n}"
139139
},
140140
"class constructor (ES2015)": {
141-
"prefix": "ctor",
141+
"prefix": "cst",
142142
"body": "constructor(${1}) {${0}}"
143143
},
144144
"method (ES2015)": {
@@ -230,7 +230,7 @@
230230
"body": "(err, ${1:response}) => {${0}}"
231231
},
232232
"require (Node.JS)": {
233-
"prefix": "require",
233+
"prefix": "re",
234234
"body": "require(${1:path})${0}"
235235
},
236236
"require assignment (Node.JS)": {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /