Skip to content

Commit 0af3b8f

Browse files
committed
Fix remaining StandardJS errors
1 parent 22bf483 commit 0af3b8f

6 files changed

Lines changed: 12 additions & 14 deletions

File tree

lib/compare-solution.js

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

35
var path = require('path')

lib/get-file.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
var fs = require('fs')
2-
var path = require('path')
32

43
module.exports = function (filepath) {
54
return fs.readFileSync(filepath, 'utf8')

lib/problem.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable standard/no-callback-literal */
2+
13
var path = require('path')
24
var getFile = require('./get-file')
35
var compare = require('./compare-solution')

lib/run-solution.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
var fs = require('fs')
2-
var path = require('path')
3-
var docs = path.join(__dirname, 'docs')
42
var exec = require('child_process').exec
53

6-
if (typeof Promise === 'undefined') {
7-
var Promise = require('promise')
8-
}
9-
104
/**
115
* @param {!string} filePath
126
* @return {Promise}
137
*/
148
function exists (filePath) {
15-
return new Promise(function (res, rej) {
9+
return new Promise(function (resolve, reject) {
1610
fs.stat(filePath, function (err, d) {
1711
if (err) {
18-
res(false)
12+
resolve(false)
1913
}
2014

21-
res(true)
15+
resolve(true)
2216
})
2317
})
2418
}
@@ -28,13 +22,13 @@ function exists (filePath) {
2822
* @return {Promise}
2923
*/
3024
function executeSolution (filePath) {
31-
return new Promise(function (res, rej) {
25+
return new Promise(function (resolve, reject) {
3226
exec('node "' + filePath + '"', function (err, stdout, stderr) {
3327
if (err) {
34-
return rej(err)
28+
return reject(err)
3529
}
3630

37-
return res(stdout)
31+
return resolve(stdout)
3832
})
3933
})
4034
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"preferGlobal": true,
1414
"dependencies": {
1515
"colors": "^1.3.3",
16-
"promise": "^8.0.3",
1716
"diff": "^4.0.1",
1817
"workshopper-adventure": "^6.0.4"
1918
},

solutions/scope/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable no-unused-vars */
2+
13
const a = 1; const b = 2; const c = 3;
24

35
(function firstFunction () {

0 commit comments

Comments
 (0)