Skip to content

Commit 3a3c9d3

Browse files
committed
refactor: Support standard/no-callback-literal in the lib/compare-solution.js
1 parent d28441c commit 3a3c9d3

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

lib/compare-solution.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable standard/no-callback-literal */
2-
31
require('colors')
42

53
var path = require('path')
@@ -10,20 +8,20 @@ module.exports = function (solution, attempt, i18n, cb) {
108
run(solution, i18n, function (err, solutionResult) {
119
if (err) {
1210
console.error(err)
13-
return cb(false)
11+
return cb(err, false)
1412
}
1513

1614
run(attempt, i18n, function (err, attemptResult) {
1715
if (err && err.code !== 8) {
1816
console.error(err)
19-
return cb(false)
17+
return cb(err, false)
2018
}
2119

2220
if (solutionResult === attemptResult) {
23-
return cb(true)
21+
return cb(err, true)
2422
}
2523

26-
cb(false, {
24+
cb(null, false, {
2725
solution: solutionResult,
2826
attempt: err || attemptResult,
2927
diff: generateDiff(solutionResult, attemptResult)

lib/problem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = function createProblem (dirname) {
2323

2424
exports.verify = function (args, cb) {
2525
var attemptPath = path.resolve(process.cwd(), args[0])
26-
compare(this.solutionPath, attemptPath, i18n, function (match, obj) {
26+
compare(this.solutionPath, attemptPath, i18n, function (_, match, obj) {
2727
if (match) {
2828
return cb(true)
2929
}

0 commit comments

Comments
 (0)