@@ -12,6 +12,20 @@ The extension automatically creates folder for react component containing :
1212- ` ComponentName.jsx `
1313- ` ComponentName.styles.js ` (for ` styled ` -component or ` emotion ` option)
1414- ` ComponentName.css ` (for ` standard ` style option)
15+ - ` ComponentName.sass ` (for ` sass ` style option)
16+ - ` ComponentName.less ` (for ` less ` style option)
17+
18+ ## Installation
19+
20+ Install through VS Code extensions. Search for ` VSCode React Component Generator `
21+
22+ [ Visual Studio Code Market Place: VSCode React Component Generator] ( https://marketplace.visualstudio.com/items?itemName=abdullahceylan.vscode-react-component-generator )
23+
24+ Can also be installed in VS Code: Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
25+
26+ ```
27+ ext install abdullahceylan.vscode-react-component-generator
28+ ```
1529
1630## Usage
1731
@@ -29,44 +43,57 @@ The extension automatically creates folder for react component containing :
2943
3044![ Container component with redux] ( assets/images/vscode-3.gif )
3145
46+ ![ Extension settings] ( assets/images/vscode-settings.png )
47+
3248## Configuration
3349You can access to the extension's settings through VSCode settings. You can customize:
3450
35- - ** global** (` object ` ):
36- - ** quotes** (string) - Options: ` single ` or ` double ` Result: ` ' ` or ` " `
37- - ** generateFolder** (` bool ` ) - generate or not separate folder for newly created component
38- - ** create** (` bool ` ) - weather to generate this file or not
39- - ** type** (` string ` ) - only for ` style ` file. Options: ` standard ` , ` styled ` or ` emotion `
40- - ** suffix** (` string ` ) - only for ` style ` file and it's optional. When you specified a suffix, style file name will be ComponentName` suffix ` .` extension ` Default: ` .styles `
41- - ** extension** (` string ` ) - extension of generated file (e.g. you might want to change stylesheet file extension of styles, replace "js" with just plain "css")
42-
43- ``` json
44- {
45- "global" : {
46- "quotes" : " single" ,
47- "generateFolder" : true ,
48- },
49- "files" : {
50- "component" : {
51- "create" : true ,
52- "extension" : " jsx" ,
53- },
54- "style" : {
55- "create" : true ,
56- "type" : " styled" ,
57- "suffix" : " .styles" ,
58- "extension" : " js"
59- },
60- "index" : {
61- "create" : true ,
62- "extension" : " js"
63- }
64- }
65- }
66- ```
51+
52+ #### ` ACReactComponentGenerator.global.generateFolder ` (default: ` true ` )
53+ Generate or not separate folder for newly created component
54+
55+ #### ` ACReactComponentGenerator.global.quotes ` (default: ` single ` )
56+ Controls the quotes for the imports in the files. Valid options:
57+ - "single" - e.g.: import React from ` ' ` react` ' `
58+ - "double" - e.g.: import React from ` " ` react` " `
59+
60+ #### ` ACReactComponentGenerator.global.lifecycleType ` (default: ` legacy ` )
61+ The lifecycle type of generated component. Valid options:
62+ - "legacy" - Contains ` componentWillReceiveProps ` , ` componentWillMount `
63+ - "reactv16" - Contains ` getSnapshotBeforeUpdate ` , ` getDerivedStateFromProps ` , ` getDerivedStateFromError ` , ` componentDidCatch ` and removes ` componentWillReceiveProps ` and ` componentWillMount `
64+
65+ #### ` ACReactComponentGenerator.indexFile.create ` (default: ` true ` )
66+ Weather to generate component's index file or not.
67+
68+ #### ` ACReactComponentGenerator.indexFile.extension ` (default: ` js ` )
69+ The extension of generated component index file. e.g.: index.(` extension ` )
70+
71+ #### ` ACReactComponentGenerator.mainFile.create ` (default: ` true ` )
72+ Weather to generate component's main file or not.
73+
74+ #### ` ACReactComponentGenerator.mainFile.extension ` (default: ` jsx ` )
75+ The extension of generated component file. e.g.: ComponentName.(` extension ` )
76+
77+ #### ` ACReactComponentGenerator.styleFile.create ` (default: ` true ` )
78+ Weather to generate component's stylesheet file or not.
79+
80+ #### ` ACReactComponentGenerator.styleFile.extension ` (default: ` jsx ` )
81+ The extension of generated stylesheet file. e.g.: ComponentName.styles.(` extension ` )
82+
83+ #### ` ACReactComponentGenerator.styleFile.suffix ` (default: ` .styles ` )
84+ The suffix to add to the end of the stylesheet filename. Default: ComponentName` .styles ` .(extension)
85+
86+ #### ` ACReactComponentGenerator.styleFile.type ` (default: ` styled-components ` )
87+ The type of stylesheet file to create. Valid options:
88+ - "styled-components (.js)" - ComponentName.styles.` js `
89+ - "emotion (.js)" - ComponentName.styles.` js `
90+ - "standard (.css)" - ComponentName.styles.` css `
91+ - "sass (.sass)" - ComponentName.styles.` sass `
92+ - "less (.less)" - ComponentName.styles.` less `
93+
6794### Changelog
68- #### 0.0.1 (2018-12-02)
69- - Initial release
95+
96+ #### [ Click here ] ( CHANGELOG.md )
7097
7198## Bugs
7299
0 commit comments