@@ -82,10 +82,9 @@ Please make sure you're pointing to the right custom template path in your gener
82
82
83
83
function componentTemplateGenerator ( { cmd, componentName, cliConfigFile } ) {
84
84
const { cssPreprocessor, testLibrary, usesCssModule, usesTypeScript } = cliConfigFile ;
85
- const { customTemplates, flat } = cliConfigFile . component [ cmd . type ] ;
85
+ const { customTemplates } = cliConfigFile . component [ cmd . type ] ;
86
86
let template = null ;
87
87
let filename = null ;
88
- const isFlat = flat || cmd . flat ;
89
88
90
89
// Check for a custom component template.
91
90
@@ -134,17 +133,16 @@ function componentTemplateGenerator({ cmd, componentName, cliConfigFile }) {
134
133
}
135
134
136
135
return {
137
- componentPath : `${ cmd . path } ${ isFlat ? '' : `/${ componentName } ` } /${ filename } ` ,
136
+ componentPath : `${ cmd . path } ${ cmd . flat ? '' : `/${ componentName } ` } /${ filename } ` ,
138
137
filename,
139
138
template,
140
139
} ;
141
140
}
142
141
143
142
function componentStyleTemplateGenerator ( { cliConfigFile, cmd, componentName } ) {
144
- const { customTemplates, flat } = cliConfigFile . component [ cmd . type ] ;
143
+ const { customTemplates } = cliConfigFile . component [ cmd . type ] ;
145
144
let template = null ;
146
145
let filename = null ;
147
- const isFlat = flat || cmd . flat ;
148
146
149
147
// Check for a custom style template.
150
148
@@ -170,18 +168,17 @@ function componentStyleTemplateGenerator({ cliConfigFile, cmd, componentName })
170
168
}
171
169
172
170
return {
173
- componentPath : `${ cmd . path } ${ isFlat ? '' : `/${ componentName } ` } /${ filename } ` ,
171
+ componentPath : `${ cmd . path } ${ cmd . flat ? '' : `/${ componentName } ` } /${ filename } ` ,
174
172
filename,
175
173
template,
176
174
} ;
177
175
}
178
176
179
177
function componentTestTemplateGenerator ( { cliConfigFile, cmd, componentName } ) {
180
- const { customTemplates, flat } = cliConfigFile . component [ cmd . type ] ;
178
+ const { customTemplates } = cliConfigFile . component [ cmd . type ] ;
181
179
const { testLibrary, usesTypeScript } = cliConfigFile ;
182
180
let template = null ;
183
181
let filename = null ;
184
- const isFlat = flat || cmd . flat ;
185
182
186
183
// Check for a custom test template.
187
184
@@ -210,18 +207,17 @@ function componentTestTemplateGenerator({ cliConfigFile, cmd, componentName }) {
210
207
}
211
208
212
209
return {
213
- componentPath : `${ cmd . path } ${ isFlat ? '' : `/${ componentName } ` } /${ filename } ` ,
210
+ componentPath : `${ cmd . path } ${ cmd . flat ? '' : `/${ componentName } ` } /${ filename } ` ,
214
211
filename,
215
212
template,
216
213
} ;
217
214
}
218
215
219
216
function componentStoryTemplateGenerator ( { cliConfigFile, cmd, componentName } ) {
220
217
const { usesTypeScript } = cliConfigFile ;
221
- const { customTemplates, flat } = cliConfigFile . component [ cmd . type ] ;
218
+ const { customTemplates } = cliConfigFile . component [ cmd . type ] ;
222
219
let template = null ;
223
220
let filename = null ;
224
- const isFlat = flat || cmd . flat ;
225
221
226
222
// Check for a custom story template.
227
223
@@ -243,18 +239,17 @@ function componentStoryTemplateGenerator({ cliConfigFile, cmd, componentName })
243
239
}
244
240
245
241
return {
246
- componentPath : `${ cmd . path } ${ isFlat ? '' : `/${ componentName } ` } /${ filename } ` ,
242
+ componentPath : `${ cmd . path } ${ cmd . flat ? '' : `/${ componentName } ` } /${ filename } ` ,
247
243
filename,
248
244
template,
249
245
} ;
250
246
}
251
247
252
248
function componentLazyTemplateGenerator ( { cmd, componentName, cliConfigFile } ) {
253
249
const { usesTypeScript } = cliConfigFile ;
254
- const { customTemplates, flat } = cliConfigFile . component [ cmd . type ] ;
250
+ const { customTemplates } = cliConfigFile . component [ cmd . type ] ;
255
251
let template = null ;
256
252
let filename = null ;
257
- const isFlat = flat || cmd . flat ;
258
253
259
254
// Check for a custom lazy template.
260
255
@@ -276,18 +271,17 @@ function componentLazyTemplateGenerator({ cmd, componentName, cliConfigFile }) {
276
271
}
277
272
278
273
return {
279
- componentPath : `${ cmd . path } ${ isFlat ? '' : `/${ componentName } ` } /${ filename } ` ,
274
+ componentPath : `${ cmd . path } ${ cmd . flat ? '' : `/${ componentName } ` } /${ filename } ` ,
280
275
filename,
281
276
template,
282
277
} ;
283
278
}
284
279
285
280
function customFileTemplateGenerator ( { componentName, cmd, cliConfigFile, componentFileType } ) {
286
- const { customTemplates, flat } = cliConfigFile . component [ cmd . type ] ;
281
+ const { customTemplates } = cliConfigFile . component [ cmd . type ] ;
287
282
const fileType = camelCase ( componentFileType . split ( 'with' ) [ 1 ] ) ;
288
283
let filename = null ;
289
284
let template = null ;
290
- const isFlat = flat || cmd . flat ;
291
285
292
286
// Check for a valid custom template for the corresponding custom component file.
293
287
@@ -315,7 +309,7 @@ Please make sure you're pointing to the right custom template path in your gener
315
309
filename = customTemplateFilename ;
316
310
317
311
return {
318
- componentPath : `${ cmd . path } ${ isFlat ? '' : `/${ componentName } ` } /${ filename } ` ,
312
+ componentPath : `${ cmd . path } ${ cmd . flat ? '' : `/${ componentName } ` } /${ filename } ` ,
319
313
filename,
320
314
template,
321
315
} ;
0 commit comments