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',
|
||||
},
|
||||
connectionLimit: {
|
||||
doc: "The maximum number of connections to create at once.",
|
||||
doc: 'The maximum number of connections to create at once.',
|
||||
default: 10,
|
||||
format: 'nat',
|
||||
env: 'MYSQL_CONNECTION_LIMIT',
|
||||
|
@ -127,7 +127,7 @@ module.exports = function (fs, path, url, convict) {
|
|||
env: 'MYSQL_SLAVE_PORT',
|
||||
},
|
||||
connectionLimit: {
|
||||
doc: "The maximum number of connections to create at once.",
|
||||
doc: 'The maximum number of connections to create at once.',
|
||||
default: 10,
|
||||
format: 'nat',
|
||||
env: 'MYSQL_SLAVE_CONNECTION_LIMIT',
|
||||
|
@ -159,7 +159,7 @@ module.exports = function (fs, path, url, convict) {
|
|||
jwt: {
|
||||
secretKeyFile: {
|
||||
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'
|
||||
},
|
||||
iss: {
|
||||
|
|
|
@ -8,10 +8,10 @@ module.exports = function (grunt) {
|
|||
grunt.config('copyright', {
|
||||
app: {
|
||||
src: [
|
||||
"{,bin/,config/,db/,scripts/}*.js"
|
||||
'{,bin/,config/,db/,scripts/}*.js'
|
||||
],
|
||||
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: {
|
||||
|
|
|
@ -7,10 +7,10 @@ module.exports = function (grunt) {
|
|||
|
||||
grunt.config('jshint', {
|
||||
files: [
|
||||
"{,bin/,config/,db/,scripts/,test/**/}*.{js,json}"
|
||||
'{,bin/,config/,db/,scripts/,test/**/}*.js'
|
||||
],
|
||||
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();
|
||||
}
|
||||
// start the pruning off, but only if enabled in config
|
||||
|
@ -672,7 +672,7 @@ module.exports = function (log, error) {
|
|||
// exposed for testing only
|
||||
MySql.prototype.retryable_ = retryable
|
||||
|
||||
var PRUNE = "CALL prune(?, ?)"
|
||||
var PRUNE = 'CALL prune(?, ?)'
|
||||
MySql.prototype.pruneTokens = function () {
|
||||
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) {
|
||||
if (!process.env.NO_COVERAGE) {
|
||||
ass.report('json', function(err, r) {
|
||||
console.log("code coverage:", r.percent + "%");
|
||||
process.stdout.write("generating coverage.html: ");
|
||||
console.log('code coverage:', r.percent + '%');
|
||||
process.stdout.write('generating coverage.html: ');
|
||||
var start = new Date();
|
||||
ass.report('html', function(err, html) {
|
||||
fs.writeFileSync(path.join(path.dirname(__dirname), 'coverage.html'),
|
||||
html);
|
||||
process.stdout.write("complete in " +
|
||||
((new Date() - start) / 1000.0).toFixed(1) + "s\n");
|
||||
process.stdout.write('complete in ' +
|
||||
((new Date() - start) / 1000.0).toFixed(1) + 's\n');
|
||||
process.exit(code);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -38,7 +38,7 @@ DB.connect(config)
|
|||
t.equal(stats.stat, 'mysql', 'stats.stat is mysql')
|
||||
t.equal(stats.errors, 0, 'have no errors')
|
||||
t.equal(stats.connections, 1, 'have one connection')
|
||||
},
|
||||
},
|
||||
function(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.equal(err.code, 500, 'error code is correct')
|
||||
var possibleErrors = [
|
||||
{ msg: "ER_BAD_NULL_ERROR", errno: 1048 },
|
||||
{ msg: "ER_NO_DEFAULT_FOR_FIELD", errno: 1364 }
|
||||
{ msg: 'ER_BAD_NULL_ERROR', errno: 1048 },
|
||||
{ msg: 'ER_NO_DEFAULT_FOR_FIELD', errno: 1364 }
|
||||
];
|
||||
var matchedError = false;
|
||||
possibleErrors.forEach(function(possibleErr) {
|
||||
|
|
|
@ -39,7 +39,7 @@ DB.connect(config)
|
|||
})
|
||||
.then(function() {
|
||||
// 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 ])
|
||||
})
|
||||
.then(function(sdf) {
|
||||
|
@ -47,7 +47,7 @@ DB.connect(config)
|
|||
})
|
||||
.then(function() {
|
||||
// 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 ])
|
||||
})
|
||||
.then(function() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче