Skip to content

Commit e3234bf

Browse files
committed
drop line numbers
We can't properly map them to the input, so I think that he line numbers will only be more confusing
1 parent f289ebb commit e3234bf

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/@tailwindcss-node/src/optimize.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)