8000 Simply snippet formatting and add $0 to end of most lines · andrew-codes/vscode-snippets@de0ffbb · GitHub
[go: up one dir, main page]

Skip to content

Commit de0ffbb

Browse files
committed
Simply snippet formatting and add $0 to end of most lines
1 parent cdad79b commit de0ffbb

File tree

2 files changed

+84
-118
lines changed

2 files changed

+84
-118
lines changed

packages/react-snippets/README.md

Lines changed: 42 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -106,78 +106,54 @@ constructor(props, context, ...rest) {
106106
```
107107
### componentWillMount (`cwm`)
108108
```javascript
109-
componentWillMount() {
110-
$0
111-
}
109+
componentWillMount() {$1}$0
112110
```
113111
### componentDidMount (`cdm`)
114112
```javascript
115-
componentDidMount() {
116-
$0
117-
}
113+
componentDidMount() {$1}$0
118114
```
119115
### componentWillReceiveProps (`cwr`)
120116
```javascript
121-
componentWillReceiveProps(nextProps) {
122-
$0
123-
}
117+
componentWillReceiveProps(nextProps) {$1}$0
124118
```
125119
### shouldComponentUpdate (`scu`)
126120
```javascript
127-
shouldComponentUpdate(nextProps, nextState) {
128-
$0
129-
}
121+
shouldComponentUpdate(nextProps, nextState) {$1}$0
130122
```
131123
### componentWillUpdate (`cwup`)
132124
```javascript
133-
componentWillUpdate(nextProps, nextState) {
134-
$0
135-
}
125+
componentWillUpdate(nextProps, nextState) {$1}$0
136126
```
137127
### componentDidUpdate (`cdup`)
138128
```javascript
139-
componentDidUpdate(prevProps, prevState) {
140-
$0
141-
}
129+
componentDidUpdate(prevProps, prevState) {$1}$0
142130
```
143131
### componentWillUnmount (`cwum`)
144132
```javascript
145-
componentWillUnmount() {
146-
$0
147-
}
133+
componentWillUnmount() {$1}$0
148134
```
149135
### bound component class method (`ccm`)
150136
```javascript
151-
${1:methodName} = () => {
152-
$0
153-
};
137+
${1:methodName} = () => ${1:{}};$0
154138
```
155139
### set state (`sst`)
156140
```javascript
157-
this.setState({
158-
$1
159-
});
141+
this.setState({$1});
160142
$0
161143
```
162144
### set state w/ function (`ssf`)
163145
```javascript
164-
this.setState((state, props) => ({
165-
$1
166-
}));
146+
this.setState((state, props) => ({$1}));
167147
$0
168148
```
169149
### destructure class props (`cdp`)
170150
```javascript
171-
const {
172-
$1
173-
} = this.props;
151+
const {$1} = this.props;
174152
$0
175153
```
176154
### destructure class state (`cds`)
177155
```javascript
178-
const {
179-
$1
180-
} = this.state;
156+
const {$1} = this.state;
181157
$0
182158
```
183159
### bind method to class (`cbnd`)
@@ -187,130 +163,120 @@ $0
187163
```
188164
### default props (`rdp`)
189165
```javascript
190-
$1.defaultProps = {
191-
$2
192-
};
166+
$1.defaultProps = {$2};
193167
$0
194168
```
195169
### propType array (`pta`)
196170
```javascript
197-
PropTypes.array,
171+
PropTypes.array,$0
198172
```
199173
### propType array required (`ptar`)
200174
```javascript
201-
PropTypes.array.isRequired,
175+
PropTypes.array.isRequired,$0
202176
```
203177
### propType bool (`ptb`)
204178
```javascript
205-
PropTypes.bool,
179+
PropTypes.bool,$0
206180
```
207181
### propType bool required (`ptbr`)
208182
```javascript
209-
PropTypes.bool.isRequired,
183+
PropTypes.bool.isRequired,$0
210184
```
211185
### propType func (`ptf`)
212186
```javascript
213-
PropTypes.func,
187+
PropTypes.func,$0
214188
```
215189
### propType func required (`ptfr`)
216190
```javascript
217-
PropTypes.func.isRequired,
191+
PropTypes.func.isRequired,$0
218192
```
219193
### propType number (`ptn`)
220194
```javascript
221-
PropTypes.number,
195+
PropTypes.number,$0
222196
```
223197
### propType number required (`ptnr`)
224198
```javascript
225-
PropTypes.number.isRequired,
199+
PropTypes.number.isRequired,$0
226200
```
227201
### propType object (`pto`)
228202
```javascript
229-
PropTypes.object,
203+
PropTypes.object,$0
230204
```
231205
### propType object required (`ptor`)
232206
```javascript
233-
PropTypes.object.isRequired,
207+
PropTypes.object.isRequired,$0
234208
```
235209
### propType string (`pts`)
236210
```javascript
237-
PropTypes.string,
211+
PropTypes.string,$0
238212
```
239213
### propTypes string required (`ptsr`)
240214
```javascript
241-
PropTypes.string.isRequired,
215+
PropTypes.string.isRequired,$0
242216
```
243217
### propType node (`ptnd`)
244218
```javascript
245-
PropTypes.node,
219+
PropTypes.node,$0
246220
```
247221
### propType node required (`ptndr`)
248222
```javascript
249-
PropTypes.node.isRequired,
223+
PropTypes.node.isRequired,$0
250224
```
251225
### propType element (`ptel`)
252226
```javascript
253-
PropTypes.element,
227+
PropTypes.element,$0
254228
```
255229
### propType element required (`ptelr`)
256230
```javascript
257-
PropTypes.element.isRequired,
231+
PropTypes.element.isRequired,$0
258232
```
259233
### propType instanceOf (`pti`)
260234
```javascript
261-
PropTypes.instanceOf($0),
235+
PropTypes.instanceOf($1),$0
262236
```
263237
### propType instanceOf required (`ptir`)
264238
```javascript
265-
PropTypes.instanceOf($0).isRequired,
239+
PropTypes.instanceOf($1).isRequired,$0
266240
```
267241
### propType enum (`pte`)
268242
```javascript
269-
PropTypes.oneOf(['$0']),
243+
PropTypes.oneOf([$1]),$0
270244
```
271245
### propType enum required (`pter`)
272246
```javascript
273-
PropTypes.oneOf(['$0']).isRequired,
247+
PropTypes.oneOf([$1]).isRequired,$0
274248
```
275249
### propType one of type (`ptot`)
276250
```javascript
277-
PropTypes.oneOfType([
278-
$0
279-
]),
251+
PropTypes.oneOfType([$1]),$0
280252
```
281253
### propType one of type required (`ptotr`)
282254
```javascript
283-
PropTypes.oneOfType([
284-
$0
285-
]).isRequired,
255+
PropTypes.oneOfType([$1]).isRequired,$0
286256
```
287257
### propType array of (`ptao`)
288258
```javascript
289-
PropTypes.arrayOf($0),
259+
PropTypes.arrayOf($1),$0
290260
```
291261
### propType array of required (`ptaor`)
292262
```javascript
293-
PropTypes.arrayOf($0).isRequired,
263+
PropTypes.arrayOf($1).isRequired,$0
294264
```
295265
### propType object of (`ptoo`)
296266
```javascript
297-
PropTypes.objectOf($0),
267+
PropTypes.objectOf($1),$0
298268
```
299269
### propType object of required (`ptoor`)
300270
```javascript
301-
PropTypes.objectOf($0).isRequired,
271+
PropTypes.objectOf($1).isRequired,$0
302272
```
303273
### propType shape (`ptsh`)
304274
```javascript
305-
PropTypes.shape({
306-
$0
307-
}),
275+
PropTypes.shape({$0}),
308276
```
309277
### propType shape required (`ptshr`)
310278
```javascript
311-
PropTypes.shape({
312-
$0
313-
}).isRequired,
279+
PropTypes.shape({$1}).isRequired,$0
314280
```
315281
### higher order component (`hoc`)
316282
```javascript
@@ -336,5 +302,5 @@ C => {
336302
ref={(el) => {
337303
this.$1 = el;
338304
}}
339-
305+
$0
340306
```

0 commit comments

Comments
 (0)
0