You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-61Lines changed: 22 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,71 +81,32 @@ and searching up the file tree until a config file is (or isn't) found.
81
81
82
82
### Basic Configuration
83
83
84
-
JSON:
85
-
86
-
```json
87
-
// .ccarc
88
-
{
89
-
"type": "class",
90
-
"path": "./src/components"
91
-
}
92
-
```
93
-
94
-
YAML:
95
-
96
-
```yaml
97
-
# .ccarc
98
-
type: class
99
-
path: ./src/components
100
-
```
84
+
An example configuration file can be found here: [.ccarc.example](.ccarc.example), you can use this
85
+
file by copying it to the root of your project.
86
+
87
+
Currently supported options are:
88
+
89
+
Option | Description
90
+
--- | ---
91
+
`type` | Default type of the component `["stateless", "class", "pure"]`
92
+
`templatesDirPath` | Default path to get the templates from the custom templates folder
93
+
`path` | Default path to create component file and folder
94
+
`jsExtension` | Default extension for your javascript file `["js", "jsx"]`
95
+
`cssExtension` | Default extension for your css file `["css", "scss", "sass", "less", false]`. Set to false if you don't want a style file
96
+
`includeTests` | Default flag to include a test file in the folder `[true, false]`
97
+
`includeStories` | Default flag to include a storybook file in the folder `[true, false]`
98
+
`indexFile` | Default flag to create an index file in the folder `[false, true]`
99
+
`connected` | Default flag to integrate connect redux in the index file `[false, true]`
100
+
`componentMethods` | Only for "class" and "pure", insert method inside the component (i.e. `["componentDidMount", "shouldComponentUpdate", "onClick"]`)
101
+
`fileNames` | Choose the specific filename for your component's file.
102
+
`fileNames.testFileMatch` | specify the match part of test file
103
+
`fileNames.testFileName` | specify the file name of your test file
104
+
`fileNames.componentFileName` | specify the component file name
105
+
`fileNames.styleFileName` | specify the style file name !!IMPORTANT: Include cssExtension.
101
106
102
107
### You can also pass a config file
103
108
104
109
1) Create a JSON file `config.json`:
105
-
106
-
```javascript
107
-
{
108
-
// Default type of component ["stateless", "class", "pure"]
109
-
"type": "stateless",
110
-
111
-
// Default path to get the templates from the custom templates folder
112
-
"templatesDirPath": "./templates",
113
-
114
-
// Default path to create component file and folder
115
-
"path": "./src/components",
116
-
117
-
// Default extension for your javascript file ["js", "jsx"]
118
-
"jsExtension": "js",
119
-
120
-
// Default extension for your css file ["css", "scss", "sass", "less", false]
121
-
// Set to false if you don't want a style file
122
-
"cssExtension": "css",
123
-
124
-
// Default flag to include a test file in the folder [true, false]
125
-
"includeTests": true,
126
-
127
-
// Default flag to include a storybook file in the folder [true, false]
128
-
"includeStories": true,
129
-
130
-
// Default flag to create an index file in the folder [false, true]
131
-
"indexFile": false,
132
-
133
-
// Default flag to integrate connect redux in the index file [false, true]
134
-
"connected": false,
135
-
136
-
// Only for "class" and "pure", insert method inside the component
0 commit comments