Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 4615d4f

Browse files
committed
fix: Fix escaping eslint output
1 parent c4529aa commit 4615d4f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3080,7 +3080,7 @@ async function run() {
30803080
catch { }
30813081
core.debug(`error running eslint?: ${eslintError}`);
30823082
try {
3083-
results = JSON.parse(eslintOutput);
3083+
results = JSON.parse(eslintOutput.replace(/\\"/g, '\\\\"'));
30843084
const stylish = __webpack_require__(279);
30853085
// log to console so github action problem matchers can work on output
30863086
console.log(stylish(results)); // eslint-disable-line no-console

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async function run(): Promise<void> {
5555
core.debug(`error running eslint?: ${eslintError}`)
5656

5757
try {
58-
results = JSON.parse(eslintOutput)
58+
results = JSON.parse(eslintOutput.replace(/\\"/g, '\\\\"'))
5959
const stylish = require('eslint/lib/formatters/stylish')
6060

6161
// log to console so github action problem matchers can work on output
@@ -65,7 +65,7 @@ async function run(): Promise<void> {
6565
core.setFailed('eslint completed with errors')
6666
}
6767
} catch (err) {
68-
core.debug(eslintOutput);
68+
core.debug(eslintOutput)
6969
core.setFailed(err.message)
7070
}
7171

0 commit comments

Comments
 (0)