Skip to content

Commit

Permalink
fix: Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Jul 7, 2024
1 parent e046252 commit 5dfad95
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/vite-plugin-checker/src/checkers/biome/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function parseBiomeOutput(output: string) {

const diagnostics: NormalizedDiagnostic[] = parsed.diagnostics.map((d) => {
const loc = {
file: d.location.path || '',
file: d.location.path?.file || '',
start: getLineAndColumn(d.location.sourceCode, d.location.span?.[0]),
end: getLineAndColumn(d.location.sourceCode, d.location.span?.[1]),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exports[`biome > serve > get initial error and subsequent error 2`] = `
]
`;
exports[`biome > serve > get initial error and subsequent error 3`] = `"[{"checkerId":"Biome","frame":" 1 | const a = 'hello'/n > 2 | var b = 'world'/n | ^^^^^^^^^^^^^^^/n 3 | const c = '!'/n 4 | var d = a + b + c/n 5 |","id":"<PROJECT_ROOT>/playground-temp/biome-default/src/index.js","level":1,"loc":{"column":1,"file":"<PROJECT_ROOT>/playground-temp/biome-default/src/index.js","line":2},"message":"[lint/style/noVar] Use let or const instead of var.","stack":""},{"checkerId":"Biome","frame":" 2 | var b = 'world'/n 3 | const c = '!'/n > 4 | var d = a + b + c/n | ^^^^^^^^^^^^^^^^^/n 5 |","id":"<PROJECT_ROOT>/playground-temp/biome-default/src/index.js","level":1,"loc":{"column":1,"file":"<PROJECT_ROOT>/playground-temp/biome-default/src/index.js","line":4},"message":"[lint/style/noVar] Use let or const instead of var.","stack":""},{"checkerId":"Biome","frame":" 2 | const b = 'world'/n 3 | const c = '!'/n > 4 | var d = a + b + c/n | ^^^^^^^^^^^^^^^^^/n 5 |","id":"<PROJECT_ROOT>/playground-temp/biome-default/src/index.js","level":1,"loc":{"column":1,"file":"<PROJECT_ROOT>/playground-temp/biome-default/src/index.js","line":4},"message":"[lint/style/noVar] Use let or const instead of var.","stack":""}]"`;
exports[`biome > serve > get initial error and subsequent error 3`] = `"[{"checkerId":"Biome","frame":" 2 | const b = 'world'/n 3 | const c = '!'/n > 4 | var d = a + b + c/n | ^^^^^^^^^^^^^^^^^/n 5 |","id":"<PROJECT_ROOT>/playground-temp/biome-default/src/index.js","level":1,"loc":{"column":1,"file":"<PROJECT_ROOT>/playground-temp/biome-default/src/index.js","line":4},"message":"[lint/style/noVar] Use let or const instead of var.","stack":""}]"`;
exports[`biome > serve > get initial error and subsequent error 4`] = `
[
Expand Down
2 changes: 2 additions & 0 deletions playground/biome-default/__tests__/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
isBuild,
isServe,
log,
resetDiagnostics,
resetReceivedLog,
sleepForEdit,
sleepForServerReady,
Expand All @@ -22,6 +23,7 @@ describe('biome', () => {

console.log('-- edit error file --')
resetReceivedLog()
resetDiagnostics()
editFile('src/index.js', (code) => code.replace(`var b = 'world'`, `const b = 'world'`))
await sleepForEdit()
expect(stringify(diagnostics)).toMatchSnapshot()
Expand Down

0 comments on commit 5dfad95

Please sign in to comment.