fix(deps): update dev deps and latest eslint

This commit is contained in:
vladikoff 2016-09-14 00:51:51 -04:00
Родитель b3adbcf66d
Коммит a929f9c9bc
21 изменённых файлов: 2070 добавлений и 1137 удалений

Просмотреть файл

@ -6,12 +6,12 @@ module.exports = function (grunt) {
'use strict'
grunt.config('eslint', {
options: {
eslintrc: '.eslintrc'
},
files: [
'{,bin/,config/,grunttasks/,lib/**/,scripts/**/,test/**/}*.js'
]
options: {
eslintrc: '.eslintrc'
},
files: [
'{,bin/,config/,grunttasks/,lib/**/,scripts/**/,test/**/}*.js'
]
})
grunt.registerTask('quicklint', 'lint the modified files', 'newer:eslint')
}

Просмотреть файл

@ -406,15 +406,17 @@ AppError.gone = function () {
}
AppError.mustResetAccount = function (email) {
return new AppError({
code: 400,
error: 'Bad Request',
errno: ERRNO.ACCOUNT_RESET,
message: 'Account must be reset'
},
{
email: email
})
return new AppError(
{
code: 400,
error: 'Bad Request',
errno: ERRNO.ACCOUNT_RESET,
message: 'Account must be reset'
},
{
email: email
}
)
}
AppError.unknownDevice = function () {

Просмотреть файл

@ -288,7 +288,7 @@ module.exports = function (level, name, options) {
Object.keys(console).forEach(
function (key) {
console[key] = function () {
console[key] = function () { // eslint-disable-line no-console
var json = { op: 'console', message: util.format.apply(null, arguments) }
if(log[key]) {
log[key](json)

Просмотреть файл

@ -16,17 +16,17 @@ function getGenericTags(info) {
if (agent) {
if (agent.ua) {
tags = tags.concat([
'agent_ua_family:' + agent.ua.family, // -> "Safari"
'agent_ua_version:' + agent.ua.toVersionString(), // -> "5.0.1"
'agent_ua_version_major:' + agent.ua.major // -> "5"
'agent_ua_family:' + agent.ua.family, // -> "Safari"
'agent_ua_version:' + agent.ua.toVersionString(), // -> "5.0.1"
'agent_ua_version_major:' + agent.ua.major // -> "5"
])
}
if (agent.os) {
tags = tags.concat([
'agent_os_version:' + agent.os.toVersionString(), // -> "5.1"
'agent_os_family:' + agent.os.family, // -> "iOS"
'agent_os_major:' + agent.os.major // -> "5"
'agent_os_version:' + agent.os.toVersionString(), // -> "5.1"
'agent_os_family:' + agent.os.family, // -> "iOS"
'agent_os_major:' + agent.os.major // -> "5"
])
}
}

Просмотреть файл

@ -213,15 +213,15 @@ module.exports = function (
}
return db.createSessionToken({
uid: account.uid,
email: account.email,
emailCode: account.emailCode,
emailVerified: account.emailVerified,
verifierSetAt: account.verifierSetAt,
createdAt: parseInt(query._createdAt),
mustVerify: enableTokenVerification && requestHelper.wantsKeys(request),
tokenVerificationId: tokenVerificationId
}, userAgentString)
uid: account.uid,
email: account.email,
emailCode: account.emailCode,
emailVerified: account.emailVerified,
verifierSetAt: account.verifierSetAt,
createdAt: parseInt(query._createdAt),
mustVerify: enableTokenVerification && requestHelper.wantsKeys(request),
tokenVerificationId: tokenVerificationId
}, userAgentString)
.then(
function (result) {
sessionToken = result
@ -1561,16 +1561,16 @@ module.exports = function (
throw error.missingRequestParameter('sessionToken')
}
return db.createKeyFetchToken({
uid: account.uid,
kA: account.kA,
wrapKb: wrapKb,
emailVerified: account.emailVerified
})
.then(
function (result) {
keyFetchToken = result
}
)
uid: account.uid,
kA: account.kA,
wrapKb: wrapKb,
emailVerified: account.emailVerified
})
.then(
function (result) {
keyFetchToken = result
}
)
}
}

Просмотреть файл

@ -81,9 +81,8 @@ module.exports = function (
.then(
function (keyFetchToken) {
return db.createPasswordChangeToken({
uid: emailRecord.uid
}
)
uid: emailRecord.uid
})
.then(
function (passwordChangeToken) {
return {
@ -146,7 +145,7 @@ module.exports = function (
var password = new Password(authPW, authSalt, verifierVersion)
var wantsKeys = requestHelper.wantsKeys(request)
var account, verifyHash, sessionToken, keyFetchToken, verifiedStatus,
devicesToNotify
devicesToNotify
getSessionVerificationStatus()
.then(fetchDevicesToNotify)
@ -259,16 +258,16 @@ module.exports = function (
// Create a verified keyFetchToken. This is deliberately verified because we don't
// want to perform an email confirmation loop.
return db.createKeyFetchToken({
uid: account.uid,
kA: account.kA,
wrapKb: wrapKb,
emailVerified: account.emailVerified
})
.then(
function (result) {
keyFetchToken = result
}
)
uid: account.uid,
kA: account.kA,
wrapKb: wrapKb,
emailVerified: account.emailVerified
})
.then(
function (result) {
keyFetchToken = result
}
)
}
}

2993
npm-shrinkwrap.json сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -64,18 +64,18 @@
},
"devDependencies": {
"commander": "2.9.0",
"eslint-config-fxa": "1.6.0",
"eslint-config-fxa": "2.1.0",
"fxa-auth-db-mysql": "git+https://github.com/mozilla/fxa-auth-db-mysql.git#master",
"fxa-conventional-changelog": "1.1.0",
"grunt": "1.0.1",
"grunt-bump": "0.8.0",
"grunt-conventional-changelog": "5.0.0",
"grunt-conventional-changelog": "6.1.0",
"grunt-copyright": "0.3.0",
"grunt-eslint": "15.0.0",
"grunt-eslint": "19.0.0",
"grunt-newer": "1.2.0",
"grunt-nsp": "2.3.1",
"hawk": "2.3.1",
"husky": "0.11.6",
"husky": "0.11.7",
"jws": "3.1.3",
"leftpad": "0.0.0",
"load-grunt-tasks": "3.5.2",
@ -84,8 +84,8 @@
"proxyquire": "1.7.10",
"simplesmtp": "0.3.35",
"sinon": "1.17.5",
"sjcl": "1.0.3",
"tap": "6.3.2",
"sjcl": "1.0.6",
"tap": "7.1.2",
"ws": "1.1.1"
}
}

5
scripts/.eslintrc Normal file
Просмотреть файл

@ -0,0 +1,5 @@
{
"rules": {
"no-console": 0
}
}

Просмотреть файл

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-disable no-console */
var Client = require('../client')
var config = {

Просмотреть файл

@ -3,6 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-disable no-console */
var cp = require('child_process')
var split = require('binary-split')
var through = require('through')
@ -10,7 +11,7 @@ var through = require('through')
var clientCount = 2
var pathStats = {}
var requests = 0
var pass = 0
var pass = 0 // eslint-disable-line no-unused-vars
var fail = 0
var start = null

Просмотреть файл

@ -6,7 +6,7 @@ var test = require('../ptaptest')
var log = {
trace: function () {},
flowEvent: function () {},
error: console.error,
error: console.error, // eslint-disable-line no-console
}
var error = require('../../lib/error.js')
var nock = require('nock')
@ -107,9 +107,9 @@ test(
// Mock a report of a failed login attempt
customsServer.post('/failedLoginAttempt', function (body) {
t.deepEqual(body, {
ip: ip,
email: email,
errno: error.ERRNO.UNEXPECTED_ERROR
ip: ip,
email: email,
errno: error.ERRNO.UNEXPECTED_ERROR
}, 'first call to /failedLoginAttempt had expected request params')
return true
}).reply(200, {})
@ -125,7 +125,7 @@ test(
// Mock a report of a password reset.
customsServer.post('/passwordReset', function (body) {
t.deepEqual(body, {
email: email,
email: email,
}, 'first call to /passwordReset had expected request params')
return true
}).reply(200, {})
@ -141,12 +141,12 @@ test(
// Mock a check that does get blocked, with a retryAfter.
customsServer.post('/check', function (body) {
t.deepEqual(body, {
ip: ip,
email: email,
action: action,
headers: request.headers,
query: request.query,
payload: request.payload,
ip: ip,
email: email,
action: action,
headers: request.headers,
query: request.query,
payload: request.payload,
}, 'second call to /check had expected request params')
return true
}).reply(200, {
@ -170,9 +170,9 @@ test(
// Mock a report of a failed login attempt that does trigger lockout.
customsServer.post('/failedLoginAttempt', function (body) {
t.deepEqual(body, {
ip: ip,
email: email,
errno: error.ERRNO.INCORRECT_PASSWORD
ip: ip,
email: email,
errno: error.ERRNO.INCORRECT_PASSWORD
}, 'second call to /failedLoginAttempt had expected request params')
return true
}).reply(200, { })
@ -193,12 +193,12 @@ test(
request.payload['foo'] = 'bar'
customsServer.post('/check', function (body) {
t.deepEqual(body, {
ip: ip,
email: email,
action: action,
headers: request.headers,
query: request.query,
payload: request.payload,
ip: ip,
email: email,
action: action,
headers: request.headers,
query: request.query,
payload: request.payload,
}, 'third call to /check had expected request params')
return true
}).reply(200, {
@ -279,12 +279,12 @@ test(
function checkRequestBody (body) {
t.deepEqual(body, {
ip: ip,
email: email,
action: action,
headers: request.headers,
query: request.query,
payload: request.payload,
ip: ip,
email: email,
action: action,
headers: request.headers,
query: request.query,
payload: request.payload,
}, 'call to /check had expected request params')
return true
}
@ -356,9 +356,9 @@ test(
function checkRequestBody (body) {
t.deepEqual(body, {
action: action,
ip: ip,
uid: uid,
action: action,
ip: ip,
uid: uid,
}, 'call to /checkAuthenticated had expected request params')
return true
}

Просмотреть файл

@ -77,12 +77,12 @@ test(
t.equal(value, 1)
t.ok(sampleRate)
t.deepEquals(tags, [
'agent_ua_family:Firefox',
'agent_ua_version:43.0',
'agent_ua_version_major:43',
'agent_os_version:10.11',
'agent_os_family:Mac OS X',
'agent_os_major:10'
'agent_ua_family:Firefox',
'agent_ua_version:43.0',
'agent_ua_version_major:43',
'agent_os_version:10.11',
'agent_os_family:Mac OS X',
'agent_os_major:10'
])
t.end()
}

Просмотреть файл

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-disable no-console */
var config = require('../config').getProperties()
// SMTP half

Просмотреть файл

@ -6,6 +6,7 @@ var P = require('../lib/promise')
var request = require('request')
const EventEmitter = require('events').EventEmitter
/* eslint-disable no-console */
module.exports = function (host, port) {
host = host || '127.0.0.1'

Просмотреть файл

@ -28,6 +28,7 @@
*
*/
/* eslint-disable no-console */
var tap = require('tap')
module.exports = function(name, testfunc, parentTest) {

Просмотреть файл

@ -6,7 +6,7 @@ var test = require('../ptaptest')
var uuid = require('uuid')
var crypto = require('crypto')
var base64url = require('base64url')
var log = { trace: console.log, info: console.log }
var log = { trace: console.log, info: console.log } // eslint-disable-line no-console
var config = require('../../config').getProperties()
var P = require('../../lib/promise')

Просмотреть файл

@ -9,7 +9,7 @@ var uuid = require('uuid')
var crypto = require('crypto')
var base64url = require('base64url')
var proxyquire = require('proxyquire')
var log = { trace: console.log, info: console.log }
var log = { trace: console.log, info: console.log } // eslint-disable-line no-console
var config = require('../../config').getProperties()
var TestServer = require('../test_server')

Просмотреть файл

@ -5,7 +5,7 @@
var tap = require('tap')
var test = tap.test
var uuid = require('uuid')
var log = { trace: console.log, info: console.log }
var log = { trace: console.log, info: console.log } // eslint-disable-line no-console
var config = require('../../config').getProperties()
var TestServer = require('../test_server')

Просмотреть файл

@ -6,7 +6,7 @@ var test = require('tap').test
var TestServer = require('../test_server')
var Client = require('../client')
var createDBServer = require('fxa-auth-db-mysql')
var log = { trace: console.log }
var log = { trace: console.log } // eslint-disable-line no-console
var config = require('../../config').getProperties()

Просмотреть файл

@ -9,6 +9,7 @@ var request = require('request')
var mailbox = require('./mailbox')
var createDBServer = require('fxa-auth-db-mysql')
/* eslint-disable no-console */
function TestServer(config, printLogs) {
this.printLogs = printLogs === false ? false : true
this.config = config