Skip to content

Commit

Permalink
QUA-460: fix calculateConfig returning Promise (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantevvp authored May 31, 2022
1 parent 8be1e6b commit efa5fb6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/eslint.js
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ async function run(console, runOptions) {
return content + "Source: http://eslint.org/docs/rules/\n"
}

function buildIssueJson(message, path) {
async function buildIssueJson(message, path) {
// ESLint doesn't emit a ruleId in the
// case of a fatal error (such as an invalid
// token)
@@ -88,7 +88,7 @@ async function run(console, runOptions) {
},
},
},
remediation_points: checks.remediationPoints(checkName, message, cli.calculateConfigForFile(path)),
remediation_points: checks.remediationPoints(checkName, message, await cli.calculateConfigForFile(path)),
}

var fingerprint = computeFingerprint(path, checkName, message.message)
@@ -201,16 +201,16 @@ async function run(console, runOptions) {
batchReport = await cli.lintFiles(batchFiles)
})

runWithTiming("report-batch" + batchNum, function() {
await runWithTimingAsync("report-batch" + batchNum, async function() {
batchReport.forEach(function(result) {
var path = result.filePath.replace(/^\/code\//, "")

result.messages.forEach(function(message) {
result.messages.forEach(async function(message) {
if (ignoreWarnings && message.severity === ESLINT_WARNING_SEVERITY) {
return
}

var readableJsonStream = buildIssueJson(message, path)
var readableJsonStream = await buildIssueJson(message, path)
var output = ""
readableJsonStream.on('data', (chunk) => {
output = output + `${JSON.stringify(chunk)}`

0 comments on commit efa5fb6

Please sign in to comment.