Skip to content

Commit

Permalink
fix: Replace all backslashes when normalizing path in getFormattedDia…
Browse files Browse the repository at this point in the history
…gnostic (#17915)

I have not bumped into any bug, I was just playing around https://lgtm.com/projects/g/vercel/next.js/, and this looked like a legit suggestion to fix
  • Loading branch information
frol committed Jan 11, 2021
1 parent 920c221 commit 7bb5f1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/lib/typescript/diagnosticFormatter.ts
Expand Up @@ -45,7 +45,7 @@ export async function getFormattedDiagnostic(
const character = pos.character + 1

let fileName = path.posix.normalize(
path.relative(baseDir, diagnostic.file.fileName).replace(/\\/, '/')
path.relative(baseDir, diagnostic.file.fileName).replace(/\\/g, '/')
)
if (!fileName.startsWith('.')) {
fileName = './' + fileName
Expand Down

0 comments on commit 7bb5f1a

Please sign in to comment.