Skip to content

Commit b5a93cf

Browse files
committed
First version
0 parents commit b5a93cf

File tree

7 files changed

+706
-0
lines changed

7 files changed

+706
-0
lines changed

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
# The JSON files contain newlines inconsistently
13+
[*.json]
14+
insert_final_newline = ignore
15+
16+
# Minified JavaScript files shouldn't be changed
17+
[**.min.js]
18+
indent_style = ignore
19+
insert_final_newline = ignore
20+
21+
[*.md]
22+
trim_trailing_whitespace = false
23+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.vscode

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## [1.0.0 - Release]
2+
3+
- First Version

README.md

Lines changed: 353 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,353 @@
1+
2+
## Usage
3+
4+
After install this snippets add this inside your settings
5+
6+
`"editor.snippetSuggestions": "top",`
7+
8+
## Snippets List
9+
10+
| Snippets | Content |
11+
| -------: | --------|
12+
| imr | Import React |
13+
| imrc | Import React Component |
14+
| imrn | Import React-Native Element |
15+
| ims | Import Styled-Components |
16+
| imsn | Import Styled-Components Native |
17+
| rct | Redux constant |
18+
| crr | Connect Redux |
19+
| sl | Stateless Component |
20+
| slc | Stateless Component Function |
21+
| ccs | Component Class |
22+
| edccs | Export default Component Class |
23+
| rrd | Redux Reducer |
24+
| rpf | Redux Pure Function |
25+
| rpc | Redux Pure Function Const |
26+
| cwm | ComponentWillMount |
27+
| cdm | ComponentDidMount |
28+
| cdu | ComponentDidUpdate |
29+
| cwu | ComponentWillUpdate |
30+
| cwum | ComponentWillUnmount |
31+
| cwrp | ComponentWillReceiveProps |
32+
| ess | EStyleSheet Style |
33+
| ed | Export default |
34+
| edl | EslintDisableLine |
35+
| styc | Styled Component |
36+
| estyc | Export Styled Component |
37+
| edstyc | Export default Styled Component |
38+
| cmmb | Comment Big Block |
39+
| log | Console Log |
40+
| tdesc | Test Describe |
41+
| tit | Test It |
42+
43+
---
44+
45+
# imr [Import React]
46+
47+
```js
48+
import React from 'react'
49+
```
50+
51+
---
52+
53+
## imrc [Import React Component]
54+
55+
```js
56+
import React, { Component } from 'react'
57+
```
58+
59+
---
60+
61+
## imrn [Import React-Native Element]
62+
63+
```js
64+
import { $1 } from 'react-native'
65+
```
66+
67+
---
68+
69+
## ims [Import Styled-Components]
70+
71+
```js
72+
import styled from 'styled-components'
73+
```
74+
75+
---
76+
77+
## imsn [Import Styled-Components Native]
78+
79+
```js
80+
import styled from 'styled-components/native'
81+
```
82+
83+
---
84+
85+
## rct [Redux Constant]
86+
87+
```js
88+
export const $1 = '$1'
89+
```
90+
91+
---
92+
93+
## crr [Connect Redux]
94+
95+
```js
96+
import { connect } from 'react-redux'
97+
```
98+
99+
---
100+
101+
## sl [Stateless Component]
102+
103+
```js
104+
const $1 = () => (
105+
$2
106+
)
107+
108+
export default $1
109+
```
110+
111+
---
112+
113+
## slc [Stateless Component Function]
114+
115+
```js
116+
function $1($2) {
117+
$3
118+
}
119+
120+
export default $1
121+
```
122+
123+
---
124+
125+
## ccs [Component Class]
126+
127+
```js
128+
class $1 extends Component {
129+
state = { $2 }
130+
render() {
131+
return (
132+
$3
133+
)
134+
}
135+
}
136+
137+
export default $1
138+
```
139+
140+
---
141+
142+
## edccs [Export default Component Class]
143+
144+
```js
145+
export default class $1 extends Component {
146+
state = { $2 }
147+
render() {
148+
return (
149+
$3
150+
)
151+
}
152+
}
153+
```
154+
155+
---
156+
157+
## rrd [Redux Reducer]
158+
159+
```js
160+
export default (state = $1, action) => {
161+
switch (action.type) {
162+
case $2:
163+
$3
164+
default:
165+
return state
166+
}
167+
}
168+
```
169+
170+
---
171+
172+
## rpf [Redux pure function]
173+
174+
```js
175+
export const $1 = '$1'
176+
177+
export function $2($3) {
178+
return {
179+
type: $1,
180+
$3
181+
}
182+
}
183+
```
184+
185+
---
186+
187+
## rpc [Redux pure function const]
188+
189+
```js
190+
export const $1 = '$1'
191+
192+
export const $2 = $3 => ({
193+
type: $1,
194+
$3
195+
})
196+
```
197+
198+
---
199+
200+
## cwm [ComponentWillMount]
201+
202+
```js
203+
componentWillMount() {
204+
$1
205+
}
206+
```
207+
208+
209+
## cwu [ComponentWillUpdate]
210+
211+
```js
212+
componentWillUpdate() {
213+
$1
214+
}
215+
```
216+
217+
---
218+
219+
## cdu [ComponentDidUpdate]
220+
221+
```js
222+
componentDidUpdate(prevProps, prevState) {
223+
$1
224+
}
225+
```
226+
227+
---
228+
229+
## cdm [ComponentDidMount]
230+
231+
```js
232+
componentDidMount() {
233+
$1
234+
}
235+
```
236+
237+
---
238+
239+
# cwum [ComponentWillUnmount]
240+
241+
```js
242+
componentWillUnmount() {
243+
$1
244+
}
245+
```
246+
247+
---
248+
249+
# cwrp [ComponentWillReceiveProps]
250+
251+
```js
252+
componentWillReceiveProps(nextProps) {
253+
$1
254+
}
255+
```
256+
257+
---
258+
259+
# ess [EStyleSheet]
260+
261+
```js
262+
import EStyleSheet from 'react-native-extended-stylesheet'
263+
264+
const styles = EStyleSheet.create({
265+
$1
266+
})
267+
268+
export default styles
269+
```
270+
271+
---
272+
273+
## ed [Export default]
274+
275+
```js
276+
export default $1
277+
```
278+
279+
---
280+
281+
## edl [Eslint Disable Line]
282+
283+
```js
284+
// eslint-disable-line
285+
```
286+
287+
---
288+
289+
## styc [Styled Component]
290+
291+
```js
292+
const $1 = styled.$2`
293+
$3
294+
`
295+
```
296+
297+
---
298+
299+
## estyc [Export Styled Component]
300+
301+
```js
302+
export const $1 = styled.$2`
303+
$3
304+
`
305+
```
306+
307+
## edstyc [Export default Styled Component]
308+
309+
```js
310+
export default styled.$1`
311+
$2
312+
`
313+
```
314+
315+
## cmmb [Comment Big Block]
316+
317+
```js
318+
/**
319+
|--------------------------------------------------
320+
| $1
321+
|--------------------------------------------------
322+
*/
323+
```
324+
325+
---
326+
327+
## log [Console Log]
328+
329+
```js
330+
console.log('====================================')
331+
console.log($1)
332+
console.log('====================================')
333+
```
334+
335+
---
336+
337+
## tdesc [Test Describe]
338+
339+
```js
340+
describe('$1', () => {
341+
$2
342+
})
343+
```
344+
345+
---
346+
347+
## tit [Test It]
348+
349+
```js
350+
it('should $1', $2($3) => {
351+
$4
352+
})
353+
```

images/logo.png

284 KB
Loading

0 commit comments

Comments
 (0)