@@ -205,9 +205,7 @@ const readConfigJS = makeStrongCache(function* readConfigJS(
205205 // @ts -expect-error - if we want to make it possible to use async configs
206206 yield * [ ] ;
207207
208- options = ( ( options as any ) as ( api : ConfigAPI ) => { } ) (
209- makeConfigAPI ( cache ) ,
210- ) ;
208+ options = ( options as any as ( api : ConfigAPI ) => { } ) ( makeConfigAPI ( cache ) ) ;
211209
212210 assertCache = true ;
213211 }
@@ -256,32 +254,30 @@ const packageToBabelConfig = makeWeakCacheSync(
256254 } ,
257255) ;
258256
259- const readConfigJSON5 = makeStaticFileCache (
260- ( filepath , content ) : ConfigFile => {
261- let options ;
262- try {
263- options = json5 . parse ( content ) ;
264- } catch ( err ) {
265- err . message = `${ filepath } : Error while parsing config - ${ err . message } ` ;
266- throw err ;
267- }
257+ const readConfigJSON5 = makeStaticFileCache ( ( filepath , content ) : ConfigFile => {
258+ let options ;
259+ try {
260+ options = json5 . parse ( content ) ;
261+ } catch ( err ) {
262+ err . message = `${ filepath } : Error while parsing config - ${ err . message } ` ;
263+ throw err ;
264+ }
268265
269- if ( ! options ) throw new Error ( `${ filepath } : No config detected` ) ;
266+ if ( ! options ) throw new Error ( `${ filepath } : No config detected` ) ;
270267
271- if ( typeof options !== "object" ) {
272- throw new Error ( `${ filepath } : Config returned typeof ${ typeof options } ` ) ;
273- }
274- if ( Array . isArray ( options ) ) {
275- throw new Error ( `${ filepath } : Expected config object but found array` ) ;
276- }
268+ if ( typeof options !== "object" ) {
269+ throw new Error ( `${ filepath } : Config returned typeof ${ typeof options } ` ) ;
270+ }
271+ if ( Array . isArray ( options ) ) {
272+ throw new Error ( `${ filepath } : Expected config object but found array` ) ;
273+ }
277274
278- return {
279- filepath,
280- dirname : path . dirname ( filepath ) ,
281- options,
282- } ;
283- } ,
284- ) ;
275+ return {
276+ filepath,
277+ dirname : path . dirname ( filepath ) ,
278+ options,
279+ } ;
280+ } ) ;
285281
286282const readIgnoreConfig = makeStaticFileCache ( ( filepath , content ) => {
287283 const ignoreDir = path . dirname ( filepath ) ;
0 commit comments