chore(cleanup): Fixed some syntax errors reported by ESLint
This commit is contained in:
Родитель
5439ce1c7d
Коммит
98e23a83c9
|
@ -81,7 +81,7 @@ module.exports = function (fs, path, url, convict) {
|
||||||
env: 'MYSQL_PORT',
|
env: 'MYSQL_PORT',
|
||||||
},
|
},
|
||||||
connectionLimit: {
|
connectionLimit: {
|
||||||
doc: "The maximum number of connections to create at once.",
|
doc: 'The maximum number of connections to create at once.',
|
||||||
default: 10,
|
default: 10,
|
||||||
format: 'nat',
|
format: 'nat',
|
||||||
env: 'MYSQL_CONNECTION_LIMIT',
|
env: 'MYSQL_CONNECTION_LIMIT',
|
||||||
|
@ -127,7 +127,7 @@ module.exports = function (fs, path, url, convict) {
|
||||||
env: 'MYSQL_SLAVE_PORT',
|
env: 'MYSQL_SLAVE_PORT',
|
||||||
},
|
},
|
||||||
connectionLimit: {
|
connectionLimit: {
|
||||||
doc: "The maximum number of connections to create at once.",
|
doc: 'The maximum number of connections to create at once.',
|
||||||
default: 10,
|
default: 10,
|
||||||
format: 'nat',
|
format: 'nat',
|
||||||
env: 'MYSQL_SLAVE_CONNECTION_LIMIT',
|
env: 'MYSQL_SLAVE_CONNECTION_LIMIT',
|
||||||
|
@ -159,7 +159,7 @@ module.exports = function (fs, path, url, convict) {
|
||||||
jwt: {
|
jwt: {
|
||||||
secretKeyFile: {
|
secretKeyFile: {
|
||||||
doc: 'Secret key to use for signing JWTs, a PEM-encoded file.',
|
doc: 'Secret key to use for signing JWTs, a PEM-encoded file.',
|
||||||
default: __dirname + '/../test/local/test-secret.pem',
|
default: path.join(__dirname, '..', 'test', 'local', 'test-secret.pem'),
|
||||||
env: 'NOTIFICATIONS_JWT_SECRET_KEY_FILE'
|
env: 'NOTIFICATIONS_JWT_SECRET_KEY_FILE'
|
||||||
},
|
},
|
||||||
iss: {
|
iss: {
|
||||||
|
|
|
@ -8,10 +8,10 @@ module.exports = function (grunt) {
|
||||||
grunt.config('copyright', {
|
grunt.config('copyright', {
|
||||||
app: {
|
app: {
|
||||||
src: [
|
src: [
|
||||||
"{,bin/,config/,db/,scripts/}*.js"
|
'{,bin/,config/,db/,scripts/}*.js'
|
||||||
],
|
],
|
||||||
options: {
|
options: {
|
||||||
pattern: "This Source Code Form is subject to the terms of the Mozilla Public"
|
pattern: 'This Source Code Form is subject to the terms of the Mozilla Public'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tests: {
|
tests: {
|
||||||
|
|
|
@ -7,10 +7,10 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
grunt.config('jshint', {
|
grunt.config('jshint', {
|
||||||
files: [
|
files: [
|
||||||
"{,bin/,config/,db/,scripts/,test/**/}*.{js,json}"
|
'{,bin/,config/,db/,scripts/,test/**/}*.js'
|
||||||
],
|
],
|
||||||
options: {
|
options: {
|
||||||
jshintrc: ".jshintrc"
|
jshintrc: '.jshintrc'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ module.exports = function (log, error) {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
var pruneIn = options.pruneEvery/2 + Math.floor(Math.random() * options.pruneEvery)
|
var pruneIn = options.pruneEvery / 2 + Math.floor(Math.random() * options.pruneEvery)
|
||||||
setTimeout(prune.bind(this), pruneIn).unref();
|
setTimeout(prune.bind(this), pruneIn).unref();
|
||||||
}
|
}
|
||||||
// start the pruning off, but only if enabled in config
|
// start the pruning off, but only if enabled in config
|
||||||
|
@ -672,7 +672,7 @@ module.exports = function (log, error) {
|
||||||
// exposed for testing only
|
// exposed for testing only
|
||||||
MySql.prototype.retryable_ = retryable
|
MySql.prototype.retryable_ = retryable
|
||||||
|
|
||||||
var PRUNE = "CALL prune(?, ?)"
|
var PRUNE = 'CALL prune(?, ?)'
|
||||||
MySql.prototype.pruneTokens = function () {
|
MySql.prototype.pruneTokens = function () {
|
||||||
log.info({ op : 'MySql.pruneTokens' })
|
log.info({ op : 'MySql.pruneTokens' })
|
||||||
|
|
||||||
|
|
|
@ -21,14 +21,14 @@ var p = spawn(path.join(path.dirname(__dirname), 'node_modules', '.bin', 'tap'),
|
||||||
p.on('close', function(code) {
|
p.on('close', function(code) {
|
||||||
if (!process.env.NO_COVERAGE) {
|
if (!process.env.NO_COVERAGE) {
|
||||||
ass.report('json', function(err, r) {
|
ass.report('json', function(err, r) {
|
||||||
console.log("code coverage:", r.percent + "%");
|
console.log('code coverage:', r.percent + '%');
|
||||||
process.stdout.write("generating coverage.html: ");
|
process.stdout.write('generating coverage.html: ');
|
||||||
var start = new Date();
|
var start = new Date();
|
||||||
ass.report('html', function(err, html) {
|
ass.report('html', function(err, html) {
|
||||||
fs.writeFileSync(path.join(path.dirname(__dirname), 'coverage.html'),
|
fs.writeFileSync(path.join(path.dirname(__dirname), 'coverage.html'),
|
||||||
html);
|
html);
|
||||||
process.stdout.write("complete in " +
|
process.stdout.write('complete in ' +
|
||||||
((new Date() - start) / 1000.0).toFixed(1) + "s\n");
|
((new Date() - start) / 1000.0).toFixed(1) + 's\n');
|
||||||
process.exit(code);
|
process.exit(code);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -38,7 +38,7 @@ DB.connect(config)
|
||||||
t.equal(stats.stat, 'mysql', 'stats.stat is mysql')
|
t.equal(stats.stat, 'mysql', 'stats.stat is mysql')
|
||||||
t.equal(stats.errors, 0, 'have no errors')
|
t.equal(stats.errors, 0, 'have no errors')
|
||||||
t.equal(stats.connections, 1, 'have one connection')
|
t.equal(stats.connections, 1, 'have one connection')
|
||||||
},
|
},
|
||||||
function(err) {
|
function(err) {
|
||||||
t.fail('this should never happen ' + err)
|
t.fail('this should never happen ' + err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,8 +203,8 @@ DB.connect(config)
|
||||||
t.pass('The call to the stored procedure failed as expected')
|
t.pass('The call to the stored procedure failed as expected')
|
||||||
t.equal(err.code, 500, 'error code is correct')
|
t.equal(err.code, 500, 'error code is correct')
|
||||||
var possibleErrors = [
|
var possibleErrors = [
|
||||||
{ msg: "ER_BAD_NULL_ERROR", errno: 1048 },
|
{ msg: 'ER_BAD_NULL_ERROR', errno: 1048 },
|
||||||
{ msg: "ER_NO_DEFAULT_FOR_FIELD", errno: 1364 }
|
{ msg: 'ER_NO_DEFAULT_FOR_FIELD', errno: 1364 }
|
||||||
];
|
];
|
||||||
var matchedError = false;
|
var matchedError = false;
|
||||||
possibleErrors.forEach(function(possibleErr) {
|
possibleErrors.forEach(function(possibleErr) {
|
||||||
|
|
|
@ -39,7 +39,7 @@ DB.connect(config)
|
||||||
})
|
})
|
||||||
.then(function() {
|
.then(function() {
|
||||||
// now set it to be a day ago
|
// now set it to be a day ago
|
||||||
var sql = "UPDATE accountResetTokens SET createdAt = createdAt - ? WHERE tokenId = ?"
|
var sql = 'UPDATE accountResetTokens SET createdAt = createdAt - ? WHERE tokenId = ?'
|
||||||
return db.write(sql, [ oneDay, user.accountResetTokenId ])
|
return db.write(sql, [ oneDay, user.accountResetTokenId ])
|
||||||
})
|
})
|
||||||
.then(function(sdf) {
|
.then(function(sdf) {
|
||||||
|
@ -47,7 +47,7 @@ DB.connect(config)
|
||||||
})
|
})
|
||||||
.then(function() {
|
.then(function() {
|
||||||
// now set it to be a day ago
|
// now set it to be a day ago
|
||||||
var sql = "UPDATE passwordForgotTokens SET createdAt = createdAt - ? WHERE tokenId = ?"
|
var sql = 'UPDATE passwordForgotTokens SET createdAt = createdAt - ? WHERE tokenId = ?'
|
||||||
return db.write(sql, [ oneDay, user.passwordForgotTokenId ])
|
return db.write(sql, [ oneDay, user.passwordForgotTokenId ])
|
||||||
})
|
})
|
||||||
.then(function() {
|
.then(function() {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче