File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
packages/@tailwindcss-node/src Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -80,21 +80,20 @@ export function optimize(
8080
8181 let start = Math . max ( 0 , warning . loc . line - context - 1 )
8282 let end = Math . min ( lines . length , warning . loc . line + context )
83- let gutterWidth = ( warning . loc . line + context ) . toString ( ) . length
8483
8584 let snippet = lines . slice ( start , end ) . map ( ( line , idx ) => {
8685 if ( start + idx + 1 === warning . loc . line ) {
87- return `${ pc . dim ( `${ ( start + idx + 1 ) . toString ( ) . padStart ( gutterWidth , ' ' ) } \u2502` ) } ${ line } `
86+ return `${ pc . dim ( `\u2502` ) } ${ line } `
8887 } else {
89- return pc . dim ( `${ ( start + idx + 1 ) . toString ( ) . padStart ( gutterWidth , ' ' ) } \u2502 ${ line } ` )
88+ return pc . dim ( `\u2502 ${ line } ` )
9089 }
9190 } )
9291
9392 snippet . splice (
9493 warning . loc . line - start ,
9594 0 ,
96- `${ ' ' . repeat ( gutterWidth ) } ${ pc . dim ( '\u2506' ) } ${ ' ' . repeat ( warning . loc . column - 1 ) } ${ pc . yellow ( `${ pc . dim ( '^--' ) } ${ warning . message } ` ) } ` ,
97- `${ ' ' . repeat ( gutterWidth ) } ${ pc . dim ( '\u2506' ) } ` ,
95+ `${ pc . dim ( '\u2506' ) } ${ ' ' . repeat ( warning . loc . column - 1 ) } ${ pc . yellow ( `${ pc . dim ( '^--' ) } ${ warning . message } ` ) } ` ,
96+ `${ pc . dim ( '\u2506' ) } ` ,
9897 )
9998
10099 output . push ( ...snippet )
You can’t perform that action at this time.
0 commit comments