chore(build): Replace JSHint with ESLint

This commit is contained in:
Peter deHaan 2015-06-17 00:17:26 -07:00
Родитель b50a9140a2
Коммит e88d81013a
12 изменённых файлов: 516 добавлений и 306 удалений

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

@ -0,0 +1,7 @@
extends: fxa/server
rules:
complexity: 0
curly: 0
semi: [2, always]
strict: 0

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

@ -153,7 +153,7 @@ MysqlStore.prototype = {
addAvatar: function addAvatar(id, uid, url, provider, selected) {
id = buf(id);
uid = buf(uid);
var store = this;
var store = this; // eslint-disable-line consistent-this
return this.getProviderByName(provider).then(function(prov) {
if (!prov) {
throw AppError.unsupportedProvider(url);
@ -251,7 +251,7 @@ MysqlStore.prototype = {
if (config.get('env') === 'test') {
MysqlStore.prototype._clear = function clear() {
var store = this;
var store = this; // eslint-disable-line consistent-this
return this._write('DELETE FROM avatar_selected;')
.then(function() {
return store._write('DELETE FROM avatars;');

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

@ -35,7 +35,7 @@ function withDriver() {
return p.then(function(store) {
store.id = unique;
logger.debug('connected', config.get('img.driver'));
return driver = store;
return driver = store; // eslint-disable-line no-return-assign
});
}

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

@ -47,7 +47,7 @@ module.exports = {
gitDir = path.sep + path.join('home', 'app', 'git');
}
var cmd = util.format('git --git-dir=%s rev-parse HEAD', gitDir);
exec(cmd, function(err, stdout) {
exec(cmd, function(err, stdout) { // eslint-disable-line handle-callback-err
commitHash = stdout.replace(/\s+/, '');
return sendReply();
});

746
npm-shrinkwrap.json сгенерированный
Просмотреть файл

@ -219,6 +219,10 @@
}
}
},
"eslint-config-fxa": {
"version": "1.4.0",
"from": "eslint-config-fxa@>=1.4.0 <2.0.0"
},
"gm": {
"version": "1.17.0",
"from": "gm@1.17.0",
@ -475,7 +479,7 @@
},
"findup-sync": {
"version": "0.1.3",
"from": "findup-sync@>=0.1.2 <0.2.0",
"from": "findup-sync@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz",
"dependencies": {
"glob": {
@ -521,183 +525,6 @@
}
}
},
"grunt-contrib-jshint": {
"version": "0.10.0",
"from": "grunt-contrib-jshint@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/grunt-contrib-jshint/-/grunt-contrib-jshint-0.10.0.tgz",
"dependencies": {
"jshint": {
"version": "2.5.11",
"from": "jshint@>=2.5.0 <2.6.0",
"resolved": "https://registry.npmjs.org/jshint/-/jshint-2.5.11.tgz",
"dependencies": {
"cli": {
"version": "0.6.6",
"from": "cli@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/cli/-/cli-0.6.6.tgz",
"dependencies": {
"glob": {
"version": "3.2.11",
"from": "glob@>=3.2.1 <3.3.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"minimatch": {
"version": "0.3.0",
"from": "minimatch@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.6.4",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.6.4.tgz"
},
"sigmund": {
"version": "1.0.1",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz"
}
}
}
}
}
}
},
"console-browserify": {
"version": "1.1.0",
"from": "console-browserify@>=1.1.0 <1.2.0",
"resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz",
"dependencies": {
"date-now": {
"version": "0.1.4",
"from": "date-now@>=0.1.4 <0.2.0",
"resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz"
}
}
},
"exit": {
"version": "0.1.2",
"from": "exit@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz"
},
"htmlparser2": {
"version": "3.8.3",
"from": "htmlparser2@>=3.8.0 <3.9.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz",
"dependencies": {
"domhandler": {
"version": "2.3.0",
"from": "domhandler@>=2.3.0 <2.4.0",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz"
},
"domutils": {
"version": "1.5.1",
"from": "domutils@>=1.5.0 <1.6.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz",
"dependencies": {
"dom-serializer": {
"version": "0.1.0",
"from": "dom-serializer@>=0.0.0 <1.0.0",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz",
"dependencies": {
"domelementtype": {
"version": "1.1.3",
"from": "domelementtype@>=1.1.1 <1.2.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz"
},
"entities": {
"version": "1.1.1",
"from": "entities@>=1.1.1 <1.2.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz"
}
}
}
}
},
"domelementtype": {
"version": "1.3.0",
"from": "domelementtype@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz"
},
"readable-stream": {
"version": "1.1.13",
"from": "readable-stream@>=1.1.0 <1.2.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
},
"entities": {
"version": "1.0.0",
"from": "entities@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz"
}
}
},
"minimatch": {
"version": "1.0.0",
"from": "minimatch@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz",
"dependencies": {
"lru-cache": {
"version": "2.6.4",
"from": "lru-cache@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.6.4.tgz"
},
"sigmund": {
"version": "1.0.1",
"from": "sigmund@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz"
}
}
},
"shelljs": {
"version": "0.3.0",
"from": "shelljs@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz"
},
"strip-json-comments": {
"version": "1.0.2",
"from": "strip-json-comments@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.2.tgz"
},
"underscore": {
"version": "1.6.0",
"from": "underscore@>=1.6.0 <1.7.0",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz"
}
}
},
"hooker": {
"version": "0.2.3",
"from": "hooker@>=0.2.3 <0.3.0",
"resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz"
}
}
},
"grunt-conventional-changelog": {
"version": "1.1.0",
"from": "grunt-conventional-changelog@>=1.1.0 <1.2.0",
@ -911,6 +738,472 @@
"from": "grunt-copyright@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/grunt-copyright/-/grunt-copyright-0.1.0.tgz"
},
"grunt-eslint": {
"version": "15.0.0",
"from": "grunt-eslint@>=15.0.0 <16.0.0",
"resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-15.0.0.tgz",
"dependencies": {
"chalk": {
"version": "1.0.0",
"from": "chalk@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz",
"dependencies": {
"ansi-styles": {
"version": "2.0.1",
"from": "ansi-styles@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz"
},
"escape-string-regexp": {
"version": "1.0.3",
"from": "escape-string-regexp@>=1.0.2 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz"
},
"has-ansi": {
"version": "1.0.3",
"from": "has-ansi@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz",
"dependencies": {
"ansi-regex": {
"version": "1.1.1",
"from": "ansi-regex@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz"
},
"get-stdin": {
"version": "4.0.1",
"from": "get-stdin@>=4.0.1 <5.0.0",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz"
}
}
},
"strip-ansi": {
"version": "2.0.1",
"from": "strip-ansi@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz",
"dependencies": {
"ansi-regex": {
"version": "1.1.1",
"from": "ansi-regex@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz"
}
}
},
"supports-color": {
"version": "1.3.1",
"from": "supports-color@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz"
}
}
},
"eslint": {
"version": "0.23.0",
"from": "eslint@>=0.23.0 <0.24.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-0.23.0.tgz",
"dependencies": {
"concat-stream": {
"version": "1.5.0",
"from": "concat-stream@>=1.4.6 <2.0.0",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.0.tgz",
"dependencies": {
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"typedarray": {
"version": "0.0.6",
"from": "typedarray@>=0.0.5 <0.1.0",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
},
"readable-stream": {
"version": "2.0.0",
"from": "readable-stream@>=2.0.0 <2.1.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.0.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"process-nextick-args": {
"version": "1.0.1",
"from": "process-nextick-args@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"util-deprecate": {
"version": "1.0.1",
"from": "util-deprecate@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz"
}
}
}
}
},
"debug": {
"version": "2.2.0",
"from": "debug@>=2.1.1 <3.0.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
"dependencies": {
"ms": {
"version": "0.7.1",
"from": "ms@0.7.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz"
}
}
},
"doctrine": {
"version": "0.6.4",
"from": "doctrine@>=0.6.2 <0.7.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-0.6.4.tgz",
"dependencies": {
"esutils": {
"version": "1.1.6",
"from": "esutils@>=1.1.6 <2.0.0",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
}
}
},
"escape-string-regexp": {
"version": "1.0.3",
"from": "escape-string-regexp@>=1.0.2 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz"
},
"escope": {
"version": "3.1.0",
"from": "escope@>=3.1.0 <4.0.0",
"resolved": "https://registry.npmjs.org/escope/-/escope-3.1.0.tgz",
"dependencies": {
"es6-map": {
"version": "0.1.1",
"from": "es6-map@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.1.tgz",
"dependencies": {
"d": {
"version": "0.1.1",
"from": "d@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz"
},
"es5-ext": {
"version": "0.10.7",
"from": "es5-ext@>=0.10.6 <0.11.0",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.7.tgz",
"dependencies": {
"es6-symbol": {
"version": "2.0.1",
"from": "es6-symbol@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz"
}
}
},
"es6-iterator": {
"version": "0.1.3",
"from": "es6-iterator@>=0.1.3 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz",
"dependencies": {
"es6-symbol": {
"version": "2.0.1",
"from": "es6-symbol@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz"
}
}
},
"es6-set": {
"version": "0.1.1",
"from": "es6-set@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.1.tgz"
},
"es6-symbol": {
"version": "0.1.1",
"from": "es6-symbol@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz"
},
"event-emitter": {
"version": "0.3.3",
"from": "event-emitter@>=0.3.1 <0.4.0",
"resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.3.tgz"
}
}
},
"es6-weak-map": {
"version": "0.1.4",
"from": "es6-weak-map@>=0.1.2 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-0.1.4.tgz",
"dependencies": {
"d": {
"version": "0.1.1",
"from": "d@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz"
},
"es5-ext": {
"version": "0.10.7",
"from": "es5-ext@>=0.10.6 <0.11.0",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.7.tgz"
},
"es6-iterator": {
"version": "0.1.3",
"from": "es6-iterator@>=0.1.3 <0.2.0",
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz"
},
"es6-symbol": {
"version": "2.0.1",
"from": "es6-symbol@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz"
}
}
},
"esrecurse": {
"version": "3.1.1",
"from": "esrecurse@>=3.1.1 <4.0.0",
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-3.1.1.tgz"
},
"estraverse": {
"version": "3.1.0",
"from": "estraverse@>=3.1.0 <4.0.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-3.1.0.tgz"
}
}
},
"espree": {
"version": "2.0.3",
"from": "espree@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/espree/-/espree-2.0.3.tgz"
},
"estraverse": {
"version": "2.0.0",
"from": "estraverse@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-2.0.0.tgz"
},
"estraverse-fb": {
"version": "1.3.1",
"from": "estraverse-fb@>=1.3.1 <2.0.0",
"resolved": "https://registry.npmjs.org/estraverse-fb/-/estraverse-fb-1.3.1.tgz"
},
"globals": {
"version": "8.0.0",
"from": "globals@>=8.0.0 <9.0.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-8.0.0.tgz"
},
"inquirer": {
"version": "0.8.5",
"from": "inquirer@>=0.8.2 <0.9.0",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.8.5.tgz",
"dependencies": {
"ansi-regex": {
"version": "1.1.1",
"from": "ansi-regex@>=1.1.1 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz"
},
"cli-width": {
"version": "1.0.1",
"from": "cli-width@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-1.0.1.tgz"
},
"figures": {
"version": "1.3.5",
"from": "figures@>=1.3.5 <2.0.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-1.3.5.tgz"
},
"lodash": {
"version": "3.9.3",
"from": "lodash@>=3.3.1 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.9.3.tgz"
},
"readline2": {
"version": "0.1.1",
"from": "readline2@>=0.1.1 <0.2.0",
"resolved": "https://registry.npmjs.org/readline2/-/readline2-0.1.1.tgz",
"dependencies": {
"mute-stream": {
"version": "0.0.4",
"from": "mute-stream@0.0.4",
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.4.tgz"
},
"strip-ansi": {
"version": "2.0.1",
"from": "strip-ansi@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz"
}
}
},
"rx": {
"version": "2.5.3",
"from": "rx@>=2.4.3 <3.0.0",
"resolved": "https://registry.npmjs.org/rx/-/rx-2.5.3.tgz"
}
}
},
"is-my-json-valid": {
"version": "2.12.0",
"from": "is-my-json-valid@>=2.10.0 <3.0.0",
"resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.0.tgz",
"dependencies": {
"generate-function": {
"version": "2.0.0",
"from": "generate-function@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz"
},
"generate-object-property": {
"version": "1.2.0",
"from": "generate-object-property@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
"dependencies": {
"is-property": {
"version": "1.0.2",
"from": "is-property@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz"
}
}
},
"jsonpointer": {
"version": "1.1.0",
"from": "jsonpointer@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-1.1.0.tgz"
},
"xtend": {
"version": "4.0.0",
"from": "xtend@>=4.0.0 <5.0.0",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
}
}
},
"js-yaml": {
"version": "3.3.1",
"from": "js-yaml@>=3.2.5 <4.0.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.3.1.tgz",
"dependencies": {
"argparse": {
"version": "1.0.2",
"from": "argparse@>=1.0.2 <1.1.0",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.2.tgz",
"dependencies": {
"lodash": {
"version": "3.9.3",
"from": "lodash@>=3.2.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.9.3.tgz"
},
"sprintf-js": {
"version": "1.0.2",
"from": "sprintf-js@>=1.0.2 <1.1.0",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.2.tgz"
}
}
},
"esprima": {
"version": "2.2.0",
"from": "esprima@>=2.2.0 <2.3.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-2.2.0.tgz"
}
}
},
"minimatch": {
"version": "2.0.8",
"from": "minimatch@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.8.tgz",
"dependencies": {
"brace-expansion": {
"version": "1.1.0",
"from": "brace-expansion@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz",
"dependencies": {
"balanced-match": {
"version": "0.2.0",
"from": "balanced-match@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz"
},
"concat-map": {
"version": "0.0.1",
"from": "concat-map@0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
}
}
}
}
},
"object-assign": {
"version": "2.1.1",
"from": "object-assign@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz"
},
"optionator": {
"version": "0.5.0",
"from": "optionator@>=0.5.0 <0.6.0",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.5.0.tgz",
"dependencies": {
"prelude-ls": {
"version": "1.1.2",
"from": "prelude-ls@>=1.1.1 <1.2.0",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz"
},
"deep-is": {
"version": "0.1.3",
"from": "deep-is@>=0.1.2 <0.2.0",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz"
},
"wordwrap": {
"version": "0.0.3",
"from": "wordwrap@>=0.0.2 <0.1.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz"
},
"type-check": {
"version": "0.3.1",
"from": "type-check@>=0.3.1 <0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.1.tgz"
},
"levn": {
"version": "0.2.5",
"from": "levn@>=0.2.5 <0.3.0",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.2.5.tgz"
},
"fast-levenshtein": {
"version": "1.0.6",
"from": "fast-levenshtein@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.0.6.tgz"
}
}
},
"path-is-absolute": {
"version": "1.0.0",
"from": "path-is-absolute@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz"
},
"strip-json-comments": {
"version": "1.0.2",
"from": "strip-json-comments@>=1.0.1 <1.1.0",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.2.tgz"
},
"text-table": {
"version": "0.2.0",
"from": "text-table@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz"
},
"user-home": {
"version": "1.1.1",
"from": "user-home@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz"
},
"xml-escape": {
"version": "1.0.0",
"from": "xml-escape@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/xml-escape/-/xml-escape-1.0.0.tgz"
}
}
}
}
},
"grunt-jscs": {
"version": "0.8.1",
"from": "grunt-jscs@>=0.8.1 <0.9.0",
@ -933,7 +1226,7 @@
},
"commander": {
"version": "2.3.0",
"from": "commander@2.3.0",
"from": "commander@>=2.3.0 <2.4.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.3.0.tgz"
},
"esprima": {
@ -1104,9 +1397,9 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz"
},
"vow": {
"version": "0.4.9",
"version": "0.4.10",
"from": "vow@>=0.4.1 <0.5.0",
"resolved": "https://registry.npmjs.org/vow/-/vow-0.4.9.tgz"
"resolved": "https://registry.npmjs.org/vow/-/vow-0.4.10.tgz"
}
}
},
@ -1381,93 +1674,6 @@
}
}
},
"jshint-stylish": {
"version": "1.0.2",
"from": "jshint-stylish@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/jshint-stylish/-/jshint-stylish-1.0.2.tgz",
"dependencies": {
"chalk": {
"version": "1.0.0",
"from": "chalk@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz",
"dependencies": {
"ansi-styles": {
"version": "2.0.1",
"from": "ansi-styles@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz"
},
"escape-string-regexp": {
"version": "1.0.3",
"from": "escape-string-regexp@>=1.0.2 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz"
},
"has-ansi": {
"version": "1.0.3",
"from": "has-ansi@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz",
"dependencies": {
"ansi-regex": {
"version": "1.1.1",
"from": "ansi-regex@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz"
},
"get-stdin": {
"version": "4.0.1",
"from": "get-stdin@>=4.0.1 <5.0.0",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz"
}
}
},
"strip-ansi": {
"version": "2.0.1",
"from": "strip-ansi@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz",
"dependencies": {
"ansi-regex": {
"version": "1.1.1",
"from": "ansi-regex@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz"
}
}
},
"supports-color": {
"version": "1.3.1",
"from": "supports-color@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz"
}
}
},
"log-symbols": {
"version": "1.0.2",
"from": "log-symbols@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz"
},
"string-length": {
"version": "1.0.0",
"from": "string-length@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/string-length/-/string-length-1.0.0.tgz",
"dependencies": {
"strip-ansi": {
"version": "2.0.1",
"from": "strip-ansi@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz",
"dependencies": {
"ansi-regex": {
"version": "1.1.1",
"from": "ansi-regex@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz"
}
}
}
}
},
"text-table": {
"version": "0.2.0",
"from": "text-table@>=0.2.0 <0.3.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz"
}
}
},
"load-grunt-tasks": {
"version": "1.0.0",
"from": "load-grunt-tasks@>=1.0.0 <2.0.0",
@ -2033,9 +2239,9 @@
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz"
},
"tough-cookie": {
"version": "1.2.0",
"version": "2.0.0",
"from": "tough-cookie@>=0.12.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-1.2.0.tgz"
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.0.0.tgz"
},
"http-signature": {
"version": "0.10.1",

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

@ -29,16 +29,16 @@
"devDependencies": {
"blanket": "^1.1.6",
"commander": "2.5.0",
"eslint-config-fxa": "^1.4.0",
"grunt": "^0.4.3",
"grunt-cli": "^0.1.13",
"grunt-contrib-jshint": "^0.10.0",
"grunt-conventional-changelog": "~1.1.0",
"grunt-copyright": "^0.1.0",
"grunt-eslint": "^15.0.0",
"grunt-jscs": "^0.8.1",
"grunt-mocha-test": "^0.12.1",
"grunt-nsp-shrinkwrap": "^0.0.3",
"insist": "0.x",
"jshint-stylish": "^1.0.0",
"load-grunt-tasks": "^1.0.0",
"mkdirp": "^0.5.0",
"mocha-text-cov": "^0.1.0",

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

@ -5,10 +5,9 @@
module.exports = function (grunt) {
'use strict';
grunt.config('jshint', {
grunt.config('eslint', {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
eslintrc: '.eslintrc'
},
app: [
'<%= mainJsFiles %>'

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

@ -8,7 +8,7 @@ module.exports = function (grunt) {
'use strict';
grunt.registerTask('lint', [
'jshint',
'eslint',
'jscs'
]);
};

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

@ -128,7 +128,6 @@ module.exports = function mock(options) {
workerFailure: function workerFailure() {
var parts = url.parse(config.get('worker.url'));
var path = '';
var headers = {
'content-type': 'image/png',
'content-length': 12696
@ -137,7 +136,6 @@ module.exports = function mock(options) {
reqheaders: headers
})
.filteringPath(function filter(_path) {
path = _path;
return _path.replace(/\/a\/[0-9a-f]{32}/g, '/a/' + MOCK_ID);
})
.post('/a/' + MOCK_ID)

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

@ -51,7 +51,7 @@ function Avatar(options) {
if (!options.host) throw new Error('option "host" is required');
this.host = options.host;
this.image = options.image ||
fs.readFileSync(path.resolve(__dirname, 'cat.png'));
}
@ -95,7 +95,7 @@ Avatar.prototype.upload = function avatarUpload(options) {
result.error = err;
return self.emit('error', result);
}
if (res.statusCode !== 201) {
result.error = new Error('Invalid response code: ' + res.statusCode);
return self.emit('error', result);
@ -122,7 +122,7 @@ Avatar.prototype.download = function avatarDownload(options) {
this.log('start:download -> %s', options.url);
var requestArgs = {
var requestArgs = {
encoding: null, // `encoding: null` will return body as a `Buffer`
uri: options.url,
gzip: true,

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

@ -113,13 +113,13 @@ function startUpload() {
log('Invalid Bearer token!: %s', options.bearer);
process.exit(1);
}
avatar = new Avatar(options);
var intervalReport = setInterval(reportStats, 2000);
intervalReport.unref();
log('Starting with concurrent: %s, count: %s, profile: %s',
log('Starting with concurrent: %s, count: %s, profile: %s',
options.concurrent, options.count, options.host);
for (var i = 0; i < options.concurrent; ++i) {
@ -140,7 +140,7 @@ avatar.on('error', function onError(error) {
avatar.on('complete:upload', function onCompleteUpload(info) {
if (options.verbose) {
var activeCount = Object.keys(transactions).length;
log('complete:upload -> xid: %s, active: %s, rc: %s, elapsedTime: %s',
log('complete:upload -> xid: %s, active: %s, rc: %s, elapsedTime: %s',
info.transactionid, activeCount, info.statusCode, info.elapsedTime);
}
@ -148,8 +148,8 @@ avatar.on('complete:upload', function onCompleteUpload(info) {
transactions[info.transactionid] = 'downloading';
avatar.download({
url: info.body.url,
imageid: info.body.id,
url: info.body.url,
imageid: info.body.id,
transactionid: info.transactionid
});
});
@ -157,7 +157,7 @@ avatar.on('complete:upload', function onCompleteUpload(info) {
avatar.on('complete:download', function onCompleteDownload(info) {
if (options.verbose) {
var activeCount = Object.keys(transactions).length;
log('complete:download -> xid: %s, active: %s, rc: %s, elapsedTime: %s',
log('complete:download -> xid: %s, active: %s, rc: %s, elapsedTime: %s',
info.transactionid, activeCount, info.statusCode, info.elapsedTime);
}
@ -172,13 +172,13 @@ avatar.on('complete:download', function onCompleteDownload(info) {
delete transactions[info.transactionid];
startUpload();
}
});
avatar.on('complete:delete', function onCompleteDelete(info) {
if (options.verbose) {
var activeCount = Object.keys(transactions).length;
log('complete:delete -> xid: %s, active: %s, rc: %s, elapsedTime: %s',
log('complete:delete -> xid: %s, active: %s, rc: %s, elapsedTime: %s',
info.transactionid, activeCount, info.statusCode, info.elapsedTime);
}

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

@ -17,20 +17,20 @@ describe('server', function() {
assert.equal(res.result.version, require('../package.json').version);
assert(res.result.commit);
// and must return an STS header
var stsHeader = res.headers['strict-transport-security'];
assert.equal(stsHeader, 'max-age=15552000; includeSubdomains');
// and must return an STS header
var stsHeader = res.headers['strict-transport-security'];
assert.equal(stsHeader, 'max-age=15552000; includeSubdomains');
// but the other security builtin headers from hapi are not set
var other = {
'x-content-type-options': 1,
'x-download-options': 1,
'x-frame-options': 1,
'x-xss-protection': 1
};
Object.keys(res.headers).forEach(function(header) {
assert.ok(!other[header.toLowerCase()]);
});
// but the other security builtin headers from hapi are not set
var other = {
'x-content-type-options': 1,
'x-download-options': 1,
'x-frame-options': 1,
'x-xss-protection': 1
};
Object.keys(res.headers).forEach(function(header) {
assert.ok(!other[header.toLowerCase()]);
});
});
});
});