Unverified Commit 7bb5f1a2 authored by Vlad Frolov's avatar Vlad Frolov Committed by GitHub

fix: Replace all backslashes when normalizing path in getFormattedDiagnostic (#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
parent 920c2215
...@@ -45,7 +45,7 @@ export async function getFormattedDiagnostic( ...@@ -45,7 +45,7 @@ export async function getFormattedDiagnostic(
const character = pos.character + 1 const character = pos.character + 1
let fileName = path.posix.normalize( let fileName = path.posix.normalize(
path.relative(baseDir, diagnostic.file.fileName).replace(/\\/, '/') path.relative(baseDir, diagnostic.file.fileName).replace(/\\/g, '/')
) )
if (!fileName.startsWith('.')) { if (!fileName.startsWith('.')) {
fileName = './' + fileName fileName = './' + fileName
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment