@@ -375,8 +375,16 @@ async function loadConfigWithExtends(configPath: string, workspaceRootDir: strin
375375 console . error ( chalk . gray ( ' ' + yamlError . mark . snippet . split ( '\n' ) . join ( '\n ' ) ) )
376376 }
377377 console . error ( '' )
378+ console . error ( chalk . red . bold ( ' === Raw file content (start) ===' ) )
379+ const rawLines = rawContent . split ( '\n' )
380+ for ( let i = 0 ; i < rawLines . length ; i ++ ) {
381+ console . error ( chalk . gray ( ` ${ String ( i + 1 ) . padStart ( 4 ) } | ${ rawLines [ i ] } ` ) )
382+ }
383+ console . error ( chalk . red . bold ( ' === Raw file content (end) ===' ) )
384+ console . error ( '' )
378385 process . exit ( 1 )
379386 }
387+ const isInsideNodeModules = absolutePath . includes ( '/node_modules/' )
380388 let isWrapped = ! ! ( rawParsed && rawParsed . $schema )
381389 let needsRewrite = false
382390
@@ -417,7 +425,9 @@ async function loadConfigWithExtends(configPath: string, workspaceRootDir: strin
417425 quotingType : '"' ,
418426 forceQuotes : false
419427 } )
420- await writeFile ( absolutePath , wrapped )
428+ if ( ! isInsideNodeModules ) {
429+ await writeFile ( absolutePath , wrapped )
430+ }
421431 rawContent = wrapped
422432 needsRewrite = false
423433 }
@@ -439,7 +449,9 @@ async function loadConfigWithExtends(configPath: string, workspaceRootDir: strin
439449 quotingType : '"' ,
440450 forceQuotes : false
441451 } )
442- await writeFile ( absolutePath , wrapped )
452+ if ( ! isInsideNodeModules ) {
453+ await writeFile ( absolutePath , wrapped )
454+ }
443455 needsRewrite = false
444456 isWrapped = true
445457 }
@@ -454,7 +466,9 @@ async function loadConfigWithExtends(configPath: string, workspaceRootDir: strin
454466 quotingType : '"' ,
455467 forceQuotes : false
456468 } )
457- await writeFile ( absolutePath , rewritten )
469+ if ( ! isInsideNodeModules ) {
470+ await writeFile ( absolutePath , rewritten )
471+ }
458472 rawContent = rewritten
459473 }
460474
@@ -493,6 +507,13 @@ async function loadConfigWithExtends(configPath: string, workspaceRootDir: strin
493507 console . error ( chalk . gray ( ' ' + yamlError . mark . snippet . split ( '\n' ) . join ( '\n ' ) ) )
494508 }
495509 console . error ( '' )
510+ console . error ( chalk . red . bold ( ' === Raw content being parsed (start) ===' ) )
511+ const contentLines = configContent . split ( '\n' )
512+ for ( let i = 0 ; i < contentLines . length ; i ++ ) {
513+ console . error ( chalk . gray ( ` ${ String ( i + 1 ) . padStart ( 4 ) } | ${ contentLines [ i ] } ` ) )
514+ }
515+ console . error ( chalk . red . bold ( ' === Raw content being parsed (end) ===' ) )
516+ console . error ( '' )
496517 process . exit ( 1 )
497518 }
498519
0 commit comments