@@ -20,18 +20,25 @@ const resolveSchema = schema => {
2020const findPropertyInSchema = ( schema , property , subProperty ) => {
2121 if ( ! schema ) return null ;
2222 if ( subProperty ) {
23- if ( schema [ property ] && typeof schema [ property ] === "object" && subProperty in schema [ property ] ) {
23+ if (
24+ schema [ property ] &&
25+ typeof schema [ property ] === "object" &&
26+ subProperty in schema [ property ]
27+ ) {
2428 return resolveSchema ( schema [ property ] [ subProperty ] ) ;
2529 }
2630 } else {
27- if ( property in schema )
28- return resolveSchema ( schema [ property ] ) ;
31+ if ( property in schema ) return resolveSchema ( schema [ property ] ) ;
2932 }
3033 for ( const name of nestedProperties ) {
3134 if ( schema [ name ] ) {
3235 for ( const item of schema [ name ] ) {
3336 const resolvedItem = resolveSchema ( item ) ;
34- const result = findPropertyInSchema ( resolvedItem , property , subProperty ) ;
37+ const result = findPropertyInSchema (
38+ resolvedItem ,
39+ property ,
40+ subProperty
41+ ) ;
3542 if ( result ) return result ;
3643 }
3744 }
@@ -44,7 +51,9 @@ const getSchemaInfo = (path, property, subProperty) => {
4451 let current = optionsSchema ;
4552 for ( const segment of pathSegments ) {
4653 if ( segment === "*" ) {
47- current = findPropertyInSchema ( current , "additionalProperties" ) || findPropertyInSchema ( current , "items" ) ;
54+ current =
55+ findPropertyInSchema ( current , "additionalProperties" ) ||
56+ findPropertyInSchema ( current , "items" ) ;
4857 } else {
4958 current = findPropertyInSchema ( current , "properties" , segment ) ;
5059 }
@@ -147,46 +156,40 @@ module.exports = function(yargs) {
147156 } ,
148157 "output-filename" : {
149158 type : "string" ,
150- describe :
151- getSchemaInfo ( "output.filename" , "description" ) ,
159+ describe : getSchemaInfo ( "output.filename" , "description" ) ,
152160 group : OUTPUT_GROUP ,
153161 defaultDescription : "[name].js" ,
154162 requiresArg : true
155163 } ,
156164 "output-chunk-filename" : {
157165 type : "string" ,
158- describe :
159- getSchemaInfo ( "output.chunkFilename" , "description" ) ,
166+ describe : getSchemaInfo ( "output.chunkFilename" , "description" ) ,
160167 group : OUTPUT_GROUP ,
161168 defaultDescription :
162169 "filename with [id] instead of [name] or [id] prefixed" ,
163170 requiresArg : true
164171 } ,
165172 "output-source-map-filename" : {
166173 type : "string" ,
167- describe :
168- getSchemaInfo ( "output.sourceMapFilename" , "description" ) ,
174+ describe : getSchemaInfo ( "output.sourceMapFilename" , "description" ) ,
169175 group : OUTPUT_GROUP ,
170176 requiresArg : true
171177 } ,
172178 "output-public-path" : {
173179 type : "string" ,
174- describe :
175- getSchemaInfo ( "output.publicPath" , "description" ) ,
180+ describe : getSchemaInfo ( "output.publicPath" , "description" ) ,
176181 group : OUTPUT_GROUP ,
177182 requiresArg : true
178183 } ,
179184 "output-jsonp-function" : {
180185 type : "string" ,
181- describe :
182- getSchemaInfo ( "output.jsonpFunction" , "description" ) ,
186+ describe : getSchemaInfo ( "output.jsonpFunction" , "description" ) ,
183187 group : OUTPUT_GROUP ,
184188 requiresArg : true
185189 } ,
186190 "output-pathinfo" : {
187191 type : "boolean" ,
188- describe :
189- getSchemaInfo ( "output.pathinfo" , "description" ) ,
192+ describe : getSchemaInfo ( "output.pathinfo" , "description" ) ,
190193 group : OUTPUT_GROUP
191194 } ,
192195 "output-library" : {
@@ -197,8 +200,7 @@ module.exports = function(yargs) {
197200 } ,
198201 "output-library-target" : {
199202 type : "string" ,
200- describe :
201- getSchemaInfo ( "output.libraryTarget" , "description" ) ,
203+ describe : getSchemaInfo ( "output.libraryTarget" , "description" ) ,
202204 choices : getSchemaInfo ( "output.libraryTarget" , "enum" ) ,
203205 group : OUTPUT_GROUP ,
204206 requiresArg : true
@@ -249,22 +251,18 @@ module.exports = function(yargs) {
249251 "watch-stdin" : {
250252 type : "boolean" ,
251253 alias : "stdin" ,
252- describe :
253- getSchemaInfo ( "watchOptions.stdin" , "description" ) ,
254+ describe : getSchemaInfo ( "watchOptions.stdin" , "description" ) ,
254255 group : ADVANCED_GROUP
255256 } ,
256257 "watch-aggregate-timeout" : {
257- describe :
258- getSchemaInfo ( "watchOptions.aggregateTimeout" , "description" ) ,
259- type :
260- getSchemaInfo ( "watchOptions.aggregateTimeout" , "type" ) ,
258+ describe : getSchemaInfo ( "watchOptions.aggregateTimeout" , "description" ) ,
259+ type : getSchemaInfo ( "watchOptions.aggregateTimeout" , "type" ) ,
261260 group : ADVANCED_GROUP ,
262261 requiresArg : true
263262 } ,
264263 "watch-poll" : {
265264 type : "string" ,
266- describe :
267- getSchemaInfo ( "watchOptions.poll" , "description" ) ,
265+ describe : getSchemaInfo ( "watchOptions.poll" , "description" ) ,
268266 group : ADVANCED_GROUP
269267 } ,
270268 hot : {
@@ -285,15 +283,13 @@ module.exports = function(yargs) {
285283 } ,
286284 "resolve-alias" : {
287285 type : "string" ,
288- describe :
289- getSchemaInfo ( "resolve.alias" , "description" ) ,
286+ describe : getSchemaInfo ( "resolve.alias" , "description" ) ,
290287 group : RESOLVE_GROUP ,
291288 requiresArg : true
292289 } ,
293290 "resolve-extensions" : {
294291 type : "array" ,
295- describe :
296- getSchemaInfo ( "resolve.alias" , "description" ) ,
292+ describe : getSchemaInfo ( "resolve.alias" , "description" ) ,
297293 group : RESOLVE_GROUP ,
298294 requiresArg : true
299295 } ,
@@ -309,15 +305,16 @@ module.exports = function(yargs) {
309305 requiresArg : true
310306 } ,
311307 "optimize-min-chunk-size" : {
312- describe :
313- getSchemaInfo ( "optimization.splitChunks.minSize" , "description" ) ,
308+ describe : getSchemaInfo (
309+ "optimization.splitChunks.minSize" ,
310+ "description"
311+ ) ,
314312 group : OPTIMIZE_GROUP ,
315313 requiresArg : true
316314 } ,
317315 "optimize-minimize" : {
318316 type : "boolean" ,
319- describe :
320- getSchemaInfo ( "optimization.minimize" , "description" ) ,
317+ describe : getSchemaInfo ( "optimization.minimize" , "description" ) ,
321318 group : OPTIMIZE_GROUP
322319 } ,
323320 prefetch : {
0 commit comments