Fixes mozilla/fxa-content-server#2582
Remove the evil JSHint from our code
All hail ESLint
Fixed README.md and CONTRIBUTING.md to remove JSHint and add ESLint
Fixed camelcase errors due to removing JSHint inline
This commit is contained in:
Sai Pc 2015-06-14 18:31:40 -07:00
Родитель 0150bee743
Коммит 5e46644f56
55 изменённых файлов: 50 добавлений и 225 удалений

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

@ -1,26 +0,0 @@
{
"bitwise": true,
"curly": true,
"eqeqeq": true,
"esnext": true,
"globalstrict": false,
"immed": true,
"indent": 2,
"maxcomplexity": 6,
"latedef": true,
"newcap": true,
"noarg": true,
"node": true,
"quotmark": "single",
"regexp": true,
"smarttabs": true,
"strict": false,
"sub": true,
"trailing": true,
"undef": true,
"unused": "vars",
"globals": {
"define": false,
"Promise": true
}
}

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

@ -18,7 +18,7 @@ Patches should be submitted as pull requests (PR).
Before submitting a PR:
- Your code must run and pass all the automated tests before you submit your PR for review. "Work in progress" pull requests are allowed to be submitted, but should be clearly labeled as such and should not be merged until all tests pass and the code has been reviewed.
- Run `grunt jshint` to make sure your code passes linting.
- Run `grunt lint` to make sure your code passes linting.
- Run `npm test` to make sure all tests still pass.
- Your patch should include new tests that cover your changes. It is your and your reviewer's responsibility to ensure your patch includes adequate tests.
@ -26,7 +26,7 @@ When submitting a PR:
- You agree to license your code under the project's open source license ([MPL 2.0](/LICENSE)).
- Base your branch off the current `master` (see below for an example workflow).
- Add both your code and new tests if relevant.
- Run `grunt jshint` and `npm test` to make sure your code passes linting and tests.
- Run `grunt lint` and `npm test` to make sure your code passes linting and tests.
- Please do not include merge commits in pull requests; include only commits with the new relevant code.
See the main [README.md](/README.md) for information on prerequisites, installing, running and testing.
@ -75,7 +75,7 @@ reference GitHub issues that this commit **Closes**.
| Task | Description |
|------|-------------|
| `grunt jshint` | run JSHint on client side and testing JavaScript. |
| `grunt lint` | run linters (ESLint, JSCS, JSONLint and amdcheck) on client side and testing JavaScript. |
| `grunt build` | build production resources. |
| `grunt clean` | remove any built production resources. |
| `grunt test` | run local Intern tests. |

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

@ -83,7 +83,7 @@ To change the default auth server edit `server/config/*.json` on your deployed i
|------|-------------|
| `grunt build` | build production resources. See [task source](grunttasks/build.js) for more documentation |
| `grunt clean` | remove any built production resources. |
| `grunt lint` | run JSHint, JSONLint, and JSCS (code style checker) on client side and testing JavaScript. |
| `grunt lint` | run ESLint, JSONLint, and JSCS (code style checker) on client side and testing JavaScript. |
| `grunt server` | run a local server running on port 3030 with development resources. |
| `grunt server:dist` | run a local server running on port 3030 with production resources. Production resources will be built as part of the task. |
| `grunt test` | run local Intern tests. |

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

@ -1,40 +0,0 @@
{
"bitwise": true,
"browser": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"es3": true,
"esnext": true,
"globalstrict": true,
"immed": true,
"indent": 2,
"jquery": true,
"latedef": true,
"newcap": true,
"noarg": true,
"node": false,
"quotmark": "single",
"regexp": true,
"smarttabs": true,
"strict": true,
"sub": true,
"trailing": true,
"undef": true,
"unused": true,
"maxcomplexity": 6,
"globals": {
"console": false,
"define": false,
"require": false,
"router": false,
"translator": true,
"FxaHead": true,
// Used in Mocha tests
"afterEach": false,
"beforeEach": false,
"describe": false,
"it": false
}
}

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

@ -8,8 +8,6 @@
// NOTE: This file must run in IE8+, so no ES5/ES6 features!
//jshint es3: true, es5: false, esnext: false
// This is loaded in the HEAD of the doc & uses a modified version of
// https://github.com/umdjs/umd/blob/master/amdWeb.js
(function (root, factory) {
@ -23,7 +21,7 @@
// Browser globals
root.FxaHead.StartupStyles = factory(root.FxaHead.Environment);
}
}(this, function (Environment) { //jshint ignore: line
}(this, function (Environment) {
'use strict';
function parseQueryParams(queryParams) {

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

@ -361,7 +361,6 @@ function (
},
initializeAuthenticationBroker: function () {
/*jshint maxcomplexity: 7 */
/*eslint complexity: [2, 7] */
if (! this._authenticationBroker) {
if (this._isFxDesktopV2()) {
@ -549,8 +548,7 @@ function (
namespace: err.namespace,
context: err.context,
param: err.param,
//jshint camelcase: false
client_id: err.client_id
client_id: err.client_id //eslint-disable-line camelcase
});
return Constants.BAD_REQUEST_PAGE + queryString;
@ -615,7 +613,6 @@ function (
},
_isOAuthVerificationSameBrowser: function () {
//jshint camelcase: false
var savedClientId = Session.oauth && Session.oauth.client_id;
return !! (this._searchParam('code') &&
(this._searchParam('service') === savedClientId));

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

@ -24,14 +24,13 @@ function (P, jwcrypto) {
// browser has native crypto, no need to fetch entropy from the server.
try {
if (window.crypto && window.crypto.getRandomValues) {
return P(true); /*jshint ignore:line*/
return P(true);
}
} catch(e) {
// some browsers blow up when trying to query window.crypto.
}
// wah wah, we need to get entropy from the server.
//jshint validthis: true
return this._fxaClient.getRandomBytes()
.then(function (bytes) {
jwcrypto.addEntropy(bytes);
@ -39,7 +38,6 @@ function (P, jwcrypto) {
}
function generateKeyPair() {
//jshint validthis: true
return ensureCryptoIsSeeded.call(this)
.then(function () {
var genKeypair = P.denodeify(jwcrypto.generateKeypair);
@ -54,7 +52,6 @@ function (P, jwcrypto) {
function certificate(audience, sessionToken) {
//TODO: check for a valid cert in localStorage first?
//jshint validthis: true
var self = this;
return generateKeyPair.call(self).then(function (kp) {
// while certSign is going over the wire, we can also sign the
@ -76,7 +73,6 @@ function (P, jwcrypto) {
}
function bundle(sessionToken, audience) {
//jshint validthis: true
return certificate.call(this, audience || this._audience, sessionToken).spread(function (cert, ass) {
return jwcrypto.cert.bundle([cert.cert], ass);
});
@ -94,4 +90,3 @@ function (P, jwcrypto) {
return Assertion;
});

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

@ -155,7 +155,7 @@ define([
* @param {Object} [data]
* @return {String}
*/
createMessageId: function (command, data) { //jshint ignore: line
createMessageId: function (command, data) {
return Date.now();
},

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

@ -12,7 +12,6 @@ define([
'use strict';
function createEvent(command, data) {
/*jshint validthis: true*/
return new this.window.CustomEvent('FirefoxAccountsCommand', {
detail: {
command: command,
@ -54,4 +53,3 @@ define([
return Channel;
});

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

@ -6,7 +6,6 @@
* A channel mixin that expects responses to sent messages. Responses
* are expected to be received via a postMessage to the window.
*/
define([
'underscore',
'lib/auth-errors'
@ -20,12 +19,10 @@ define([
}
function getOutstandingRequest(command) {
/*jshint validthis: true*/
return this._outstandingRequests[command];
}
function clearOutstandingRequest(command) {
/*jshint validthis: true*/
var outstandingRequest = getOutstandingRequest.call(this, command);
if (outstandingRequest) {
this.window.clearTimeout(outstandingRequest.timeout);
@ -34,7 +31,6 @@ define([
}
function setResponseTimeoutTimer(outstandingRequest) {
/*jshint validthis: true*/
outstandingRequest.timeout = this.window.setTimeout(function (command) {
this.window.console.error('Response not received for: ' + command);
}.bind(this, outstandingRequest.command), this._sendTimeoutLength);

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

@ -9,8 +9,6 @@
// NOTE: This is run in the HEAD of the document, and must support IE8+.
// No ES5/ES6 features!
//jshint es3: true, es5: false, esnext: false
// This is loaded in the HEAD of the doc & uses a modified version of
// https://github.com/umdjs/umd/blob/master/amdWeb.js
(function (root, factory) {
@ -23,7 +21,7 @@
// Browser globals
root.FxaHead.Environment = factory();
}
}(this, function () { //jshint ignore: line
}(this, function () {
'use strict';
function Environment(win) {

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

@ -62,7 +62,6 @@ define([
}
function Metrics (options) {
/*jshint maxcomplexity:18 */
/*eslint complexity: [2, 18] */
options = options || {};

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

@ -40,10 +40,8 @@ function (xhr, OAuthErrors) {
// params = { assertion, client_id, scope }
getToken: function (params) {
/* jshint camelcase: false */
// Use the special 'token' response type
params.response_type = 'token';
params.response_type = 'token'; //eslint-disable-line camelcase
return this.getCode(params);
},

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

@ -11,7 +11,6 @@ define([
var NOT_REPORTED_VALUE = 'none';
function ScreenInfo(win) {
/*jshint maxcomplexity:8 */
/*eslint complexity: [2, 8] */
var documentElement = win.document.documentElement || {};
var screen = win.screen || {};

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

@ -129,13 +129,12 @@ define([
},
createOAuthToken: function (scope) {
/* jshint camelcase: false */
var self = this;
return self._assertion.generate(self.get('sessionToken'))
.then(function (assertion) {
var params = {
client_id: self._oAuthClientId,
client_id: self._oAuthClientId, //eslint-disable-line camelcase
scope: scope,
assertion: assertion
};

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

@ -72,8 +72,7 @@ function (_, Constants, Url, OAuthErrors, AuthErrors, p, Validate,
var relier = self.relier;
var oauthParams = {
assertion: assertion,
//jshint camelcase: false
client_id: relier.get('clientId'),
client_id: relier.get('clientId'), //eslint-disable-line camelcase
scope: relier.get('scope'),
state: relier.get('state')
};
@ -124,8 +123,7 @@ function (_, Constants, Url, OAuthErrors, AuthErrors, p, Validate,
var relier = self.relier;
self.session.set('oauth', {
webChannelId: self.get('webChannelId'),
//jshint camelcase: false
client_id: relier.get('clientId'),
client_id: relier.get('clientId'), //eslint-disable-line camelcase
state: relier.get('state'),
keys: relier.get('keys'),
scope: relier.get('scope'),

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

@ -140,15 +140,13 @@ define([
// redirect back to the RP but not sign in.
resumeObj = {
service: self.getSearchParam('service'),
//jshint camelcase: false
client_id: self.getSearchParam('service')
client_id: self.getSearchParam('service') //eslint-disable-line camelcase
};
}
self.set({
state: resumeObj.state,
keys: resumeObj.keys,
//jshint camelcase: false
clientId: resumeObj.client_id,
redirectUri: resumeObj.redirect_uri,
scope: resumeObj.scope
@ -192,7 +190,6 @@ define([
return self._oAuthClient.getClientInfo(clientId)
.then(function (serviceInfo) {
self.set('serviceName', serviceInfo.name);
//jshint camelcase: false
// server version always takes precedent over the search parameter
self.set('redirectUri', serviceInfo.redirect_uri);
self.set('termsUri', serviceInfo.terms_uri);
@ -205,8 +202,7 @@ define([
if (OAuthErrors.is(err, 'INVALID_REQUEST_SIGNATURE')) {
err = OAuthErrors.toError('UNKNOWN_CLIENT');
// used for logging the error on the server.
//jshint camelcase: false
err.client_id = clientId;
err.client_id = clientId; //eslint-disable-line camelcase
}
throw err;
});
@ -237,5 +233,3 @@ define([
return OAuthRelier;
});

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

@ -31,7 +31,6 @@ function (Cocktail, _, Backbone, $, p, AuthErrors,
var nullMetrics = new NullMetrics();
function displaySuccess(displayStrategy, msg) {
/*jshint validthis: true*/
this.hideError();
if (msg) {
@ -44,8 +43,6 @@ function (Cocktail, _, Backbone, $, p, AuthErrors,
}
function displayError(displayStrategy, err) {
/*jshint validthis: true*/
// Errors are disabled on page unload to supress errors
// caused by aborted XHR requests.
if (! this._areErrorsEnabled) {
@ -87,7 +84,6 @@ function (Cocktail, _, Backbone, $, p, AuthErrors,
var BaseView = Backbone.View.extend({
constructor: function (options) {
/*jshint maxcomplexity:10 */
/*eslint complexity: [2, 10] */
options = options || {};

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

@ -46,7 +46,6 @@ function (_) {
};
function clearAllTimeouts() {
/*jshint validthis: true*/
var win = this.window || window;
_.each(this._timeouts, function (timeout) {

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

@ -27,8 +27,7 @@
});
str += 'end_of_record\n';
/* jshint camelcase: false */
window._$blanket_LCOV = (window._$blanket_LCOV || '') + str;
window._$blanket_LCOV = (window._$blanket_LCOV || '') + str; //eslint-disable-line camelcase
};
/* global blanket */

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

@ -10,7 +10,7 @@ define([
function deepStub(target, source) {
for (var key in source) {
if (typeof source[key] === 'function') {
target[key] = function () {}; //jshint ignore:line
target[key] = function () {};
}
if (typeof source[key] === 'object') {

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

@ -15,7 +15,6 @@ define([
* To destroy the fakeServer, call fakeServer.destroy();
*/
function MockOAuthServers() {
/*jshint camelcase: false*/
this.fakeServer = sinon.fakeServer.create();
this.fakeServer.autoRespond = true;
@ -37,8 +36,8 @@ define([
'Content-Type': 'application/json'
}, JSON.stringify({
name: '123Done',
image_uri: 'https://mozorg.cdn.mozilla.net/media/img/firefox/new/header-firefox.png',
redirect_uri: 'http://127.0.0.1:8080/api/oauth'
image_uri: 'https://mozorg.cdn.mozilla.net/media/img/firefox/new/header-firefox.png', //eslint-disable-line camelcase
redirect_uri: 'http://127.0.0.1:8080/api/oauth' //eslint-disable-line camelcase
}));
});
}

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

@ -37,6 +37,7 @@ function (chai, sinon, AppStart, Session, Constants, p, Url, OAuthErrors,
'use strict';
/*global describe, beforeEach, it*/
/*eslint-disable camelcase */
var assert = chai.assert;
var FIRSTRUN_ORIGIN = 'https://firstrun.firefox.com';
var HELLO_ORIGIN = 'https://hello.firefox.com';
@ -207,7 +208,6 @@ function (chai, sinon, AppStart, Session, Constants, p, Url, OAuthErrors,
it('returns a WebChannel broker if verifying in the same brower where a signup was initiated from a web channel', function () {
Session.set('oauth', {
//jshint camelcase: false
client_id: 'client id',
webChannelId: 'channel id'
});
@ -226,7 +226,6 @@ function (chai, sinon, AppStart, Session, Constants, p, Url, OAuthErrors,
windowMock.top = new WindowMock();
windowMock.location.search = Url.objToSearchString({
context: Constants.IFRAME_CONTEXT,
//jshint camelcase: false
client_id: 'client id'
});
@ -236,7 +235,6 @@ function (chai, sinon, AppStart, Session, Constants, p, Url, OAuthErrors,
it('returns a Redirect broker if `context=iframe` is not present and in an iframe - for Marketplace on Android', function () {
windowMock.top = new WindowMock();
windowMock.location.search = Url.objToSearchString({
//jshint camelcase: false
client_id: 'client id'
});
@ -247,7 +245,6 @@ function (chai, sinon, AppStart, Session, Constants, p, Url, OAuthErrors,
describe('redirect', function () {
it('returns a Redirect broker if `client_id` is available', function () {
windowMock.location.search = Url.objToSearchString({
//jshint camelcase: false
client_id: 'client id'
});

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

@ -17,7 +17,7 @@ function (chai, sinon, OAuthClient, OAuthErrors, Xhr, p) {
'use strict';
/*global beforeEach, afterEach, describe, it*/
/*eslint-disable camelcase */
var OAUTH_URL = 'http://127.0.0.1:9010';
var RP_URL = 'http://127.0.0.1:8080/api/oauth';
var assert = chai.assert;
@ -26,8 +26,6 @@ function (chai, sinon, OAuthClient, OAuthErrors, Xhr, p) {
var xhr;
describe('lib/oauth-client', function () {
/* jshint camelcase: false */
beforeEach(function () {
server = sinon.fakeServer.create();
server.autoRespond = true;
@ -80,7 +78,6 @@ function (chai, sinon, OAuthClient, OAuthErrors, Xhr, p) {
});
});
/* jshint camelcase: false */
describe('getCode', function () {
var params = {
assertion: 'assertion',

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

@ -38,9 +38,7 @@ function (chai, _, XSS, Constants) {
});
it('disallows javascript: href', function () {
/*eslint-disable */
expectEmpty('javascript:alert(1)'); // jshint ignore:line
/*eslint-enable */
expectEmpty('javascript:alert(1)'); //eslint-disable-line no-script-url
});
it('disallows href without a scheme', function () {

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

@ -20,6 +20,7 @@ define([
p, RelierKeys, ResumeToken, Url, WindowMock, TestHelpers) {
'use strict';
/*eslint-disable camelcase */
var assert = chai.assert;
describe('models/reliers/oauth', function () {
@ -42,7 +43,6 @@ define([
var RESUME_INFO = {
state: STATE,
//jshint camelcase: false
client_id: CLIENT_ID,
scope: SCOPE,
action: ACTION
@ -74,7 +74,6 @@ define([
preVerifyToken: PREVERIFY_TOKEN,
service: SERVICE,
state: STATE,
//jshint camelcase: false
client_id: CLIENT_ID,
redirect_uri: REDIRECT_URI,
scope: SCOPE,
@ -105,7 +104,6 @@ define([
preVerifyToken: PREVERIFY_TOKEN,
service: SERVICE,
state: STATE,
//jshint camelcase: false
client_id: CLIENT_ID,
redirect_uri: REDIRECT_URI,
scope: SCOPE,
@ -180,7 +178,6 @@ define([
it('populates service with client_id if service is not set', function () {
windowMock.location.search = TestHelpers.toSearchString({
//jshint camelcase: false
client_id: CLIENT_ID,
scope: SCOPE
});
@ -193,7 +190,6 @@ define([
it('populates permissions from scope', function () {
windowMock.location.search = TestHelpers.toSearchString({
//jshint camelcase: false
client_id: CLIENT_ID,
scope: SCOPE
});
@ -206,7 +202,6 @@ define([
it('sanitizes the scope of untrusted reliers', function () {
windowMock.location.search = TestHelpers.toSearchString({
//jshint camelcase: false
client_id: CLIENT_ID,
scope: SCOPE_WITH_EXTRAS
});
@ -224,7 +219,6 @@ define([
it('does not sanitize the scope of trusted reliers', function () {
windowMock.location.search = TestHelpers.toSearchString({
//jshint camelcase: false
client_id: CLIENT_ID,
scope: SCOPE_WITH_EXTRAS
});
@ -285,7 +279,6 @@ define([
it('isTrusted when `trusted` is true', function () {
windowMock.location.search = TestHelpers.toSearchString({
//jshint camelcase: false
client_id: CLIENT_ID,
scope: SCOPE
});
@ -305,7 +298,6 @@ define([
it('!isTrusted when `trusted` is false', function () {
windowMock.location.search = TestHelpers.toSearchString({
//jshint camelcase: false
client_id: CLIENT_ID,
scope: SCOPE
});
@ -347,7 +339,6 @@ define([
var resumeToken = ResumeToken.stringify(resumeData);
windowMock.location.search = TestHelpers.toSearchString({
//jshint camelcase: false
client_id: CLIENT_ID,
scope: SCOPE,
resume: resumeToken

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

@ -96,8 +96,7 @@ function (chai, $, sinon, View, p, Session, FxaClient, Metrics, OAuthClient,
sinon.stub(oAuthClient, 'getClientInfo', function () {
return p({
name: '123Done',
//jshint camelcase: false
redirect_uri: BASE_REDIRECT_URL
redirect_uri: BASE_REDIRECT_URL //eslint-disable-line camelcase
});
});

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

@ -4,7 +4,7 @@
module.exports = function (grunt) {
grunt.config('clean', {
tos_pp: {
tos_pp: { //eslint-disable-line camelcase
files: [{
dot: true,
src: [

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

@ -22,7 +22,7 @@ module.exports = function (grunt) {
]
}]
},
tos_pp: {
tos_pp: { //eslint-disable-line camelcase
// The legal repo use es-ES but we (in accordance with Verbatim) use es,
// so copy es-ES templates to es
files: [
@ -46,7 +46,7 @@ module.exports = function (grunt) {
}
]
},
error_pages: {
error_pages: { //eslint-disable-line camelcase
files: [
{
expand: true,

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

@ -1,32 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
module.exports = function (grunt) {
grunt.config('jshint', {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
grunt: [
'Gruntfile.js',
'grunttasks/*.js'
],
app: {
options: {
jshintrc: '<%= yeoman.app %>/.jshintrc'
},
src: [
'<%= yeoman.app %>/**/*.js',
'!<%= yeoman.app %>/bower_components/**',
'!<%= yeoman.app %>/scripts/vendor/**'
]
},
tests: [
'<%= yeoman.tests %>/**/*.js'
],
server: [
'<%= yeoman.server %>/**/*.js',
]
});
};

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

@ -8,8 +8,7 @@ module.exports = function (grunt) {
src: [
'.bowerrc',
'.eslintrc',
'.jscsrc',
'.jshintrc'
'.jscsrc'
]
},
app: {

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

@ -110,7 +110,7 @@ module.exports = function (grunt) {
l10n: context,
locale: context.locale,
lang: context.lang,
lang_dir: context.lang_dir,
lang_dir: context.lang_dir, //eslint-disable-line camelcase
fontSupportDisabled: context.fontSupportDisabled,
terms: terms,
privacy: privacy

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

@ -7,7 +7,6 @@
module.exports = function (grunt) {
grunt.registerTask('lint', 'lint all the things', [
'eslint',
'jshint',
'jsonlint:app',
'jscs',
'amdcheck'

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

@ -20,7 +20,7 @@ module.exports = function (grunt) {
gfm: true,
sanitize: false
},
tos_pp: {
tos_pp: { //eslint-disable-line camelcase
files: [
{
expand: true,

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

@ -13,8 +13,7 @@ module.exports = function (grunt) {
options: {
format: 'raw',
fuzzy: true,
/*jshint camelcase: false*/
output_filename: function (file) {
output_filename: function (file) { //eslint-disable-line camelcase
/**
* the files are stored in the locale subdirectory with a directory
@ -42,7 +41,7 @@ module.exports = function (grunt) {
}
return locale + '/' + filename;
},
output_transform: function (data) {
output_transform: function (data) { //eslint-disable-line camelcase
// write the first translation only, ignore pluralization.
var isArray = function (item) {
return Object.prototype.toString.call(item) === '[object Array]';

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

@ -4,7 +4,7 @@
module.exports = function (grunt) {
grunt.config('replace', {
tos_pp: {
tos_pp: { //eslint-disable-line camelcase
src: [
'<%= yeoman.pp_md_src %>/*.md',
'<%= yeoman.tos_md_src %>/*.md'

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

@ -4,7 +4,7 @@
module.exports = function (grunt) {
grunt.config('useminPrepare', {
client_rendered: {
client_rendered: { //eslint-disable-line camelcase
dest: '<%= yeoman.dist %>',
src: [
'<%= yeoman.app %>/{,*/}*.html',
@ -12,7 +12,7 @@ module.exports = function (grunt) {
],
type: 'html'
},
server_rendered: {
server_rendered: { //eslint-disable-line camelcase
options: {
// root must be specified or else useminPrepare uses the template
// directory as the root from where to search for assets.

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

@ -8,6 +8,7 @@ module.exports = function (grunt) {
var TOS_PP_REPO_ROOT = 'app/bower_components/tos-pp';
grunt.config('yeoman', {
/*eslint-disable camelcase */
app: 'app',
dist: 'dist',
server: 'server',

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

@ -73,12 +73,11 @@
"devDependencies": {
"awsbox": "0.7.0",
"coveralls": "2.11.1",
"eslint-config-fxa": "1.6.0",
"eslint-config-fxa": "1.7.0",
"firefox-profile": "0.3.3",
"grunt-amdcheck": "1.3.1",
"grunt-bump": "0.0.15",
"grunt-contrib-csslint": "0.2.0",
"grunt-contrib-jshint": "0.10.0",
"grunt-contrib-watch": "0.6.1",
"grunt-conventional-changelog": "1.1.0",
"grunt-copyright": "0.1.0",
@ -88,8 +87,6 @@
"grunt-nsp-shrinkwrap": "0.0.3",
"grunt-todo": "0.4.0",
"intern": "git://github.com/theintern/intern#42aebd9beb942a11e2c6e6d7687c70a1c22b9bf7",
"jshint": "2.5.3",
"jshint-stylish": "0.4.0",
"sync-exec": "0.5.0",
"xmlhttprequest": "git://github.com/zaach/node-XMLHttpRequest.git#onerror"
},

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

@ -1,7 +0,0 @@
{
"extends": "../.jshintrc",
"globalstrict": true,
"globals": {
"module": true
}
}

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

@ -4,7 +4,6 @@
// It's a 404 not found response.
/*jshint unused: false */
module.exports = function (req, res, next) {
res.status(404);

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

@ -7,7 +7,6 @@ var logger = require('mozlog')('route.500');
// It's a 500 server error response.
/*jshint unused: false */
module.exports = function (err, req, res, next) {
res.status(500);

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

@ -2,7 +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 camelcase */
var convict = require('convict');
var fs = require('fs');
var path = require('path');

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

@ -10,7 +10,7 @@
var helmet = require('helmet');
var config = require('./configuration');
var url = require('url');
var SELF = "'self'"; //jshint ignore: line
var SELF = "'self'";
var DATA = 'data:';
var GRAVATAR = 'https://secure.gravatar.com';

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

@ -12,7 +12,7 @@
*
*/
/*eslint-disable camelcase */
module.exports = function (config) {
// this is perhaps a bit janky. In dev mode, a `t` helper needs to be

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

@ -59,7 +59,7 @@ function addNavigationTiming(loggableEvent, event) {
function addEvents(loggableEvent, event) {
if (event.events && event.events.forEach) {
loggableEvent.events = [];
loggableEvent.event_durations = [];
loggableEvent.event_durations = []; //eslint-disable-line camelcase
event.events.forEach(function (event) {
loggableEvent.events.push(event.type);

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

@ -76,8 +76,8 @@ module.exports = function (config, i18n) {
var coverNever = JSON.stringify(config.get('tests.coverage.excludeFiles'));
return res.render('mocha', {
check_coverage: checkCoverage,
cover_never: coverNever
check_coverage: checkCoverage, //eslint-disable-line camelcase
cover_never: coverNever //eslint-disable-line camelcase
});
});
}
@ -180,7 +180,7 @@ module.exports = function (config, i18n) {
namespace: req.query.namespace,
context: req.query.context,
param: req.query.param,
client_id: req.query.client_id
client_id: req.query.client_id //eslint-disable-line camelcase
});
return res.render('400', {
message: req.query.message

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

@ -15,7 +15,7 @@
var fs = require('fs');
var path = require('path');
var util = require('util');
var child_process = require('child_process');
var child_process = require('child_process'); //eslint-disable-line camelcase
var Promise = require('bluebird');
var logger = require('mozlog')('server.ver.json');
@ -52,7 +52,7 @@ function getCommitHashFromGit() {
var gitDir = getGitDir();
var cmd = util.format('git %s rev-parse HEAD', gitDir ? '--git-dir=' + gitDir : '');
child_process.exec(cmd, function (err, stdout) {
child_process.exec(cmd, function (err, stdout) { //eslint-disable-line camelcase
deferred.resolve(stdout.replace(/\s+/, ''));
});

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

@ -10,7 +10,6 @@ var uaParser = require('ua-parser');
var STATSD_PREFIX = 'fxa.content.';
function getGenericTags(body) {
/*jshint maxcomplexity:7 */
/*eslint complexity: [2, 7] */
// see more about tags here: http://docs.datadoghq.com/guides/metrics/
var tags = [

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

@ -137,7 +137,6 @@ define([
function testRepopulateFields(dest, header) {
/*jshint validthis: true*/
var self = this;
return openFxa(self, email)

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

@ -10,7 +10,7 @@ define([
'intern/dojo/Promise',
'require',
'intern/node_modules/dojo/has!host-node?intern/node_modules/dojo/node!child_process'
], function (intern, registerSuite, assert, config, Promise, require, child_process) {
], function (intern, registerSuite, assert, config, Promise, require, child_process) { //eslint-disable-line camelcase
var ERROR_COLOR = '\x1b[1;31m'; // red
var DESCRIPTION_COLOR = '\x1b[1;36m'; // cyan
var DEFAULT_COLOR = '\x1b[0;0m'; // off
@ -94,7 +94,7 @@ define([
*/
function sendCoverageToCoveralls(context) {
var dfd = new Promise.Deferred();
var spawn = child_process.spawn;
var spawn = child_process.spawn; //eslint-disable-line camelcase
console.log('Sending code coverage to coveralls.io');
context.remote

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

@ -173,7 +173,6 @@ define([
});
function testRepopulateFields(dest, header) {
/*jshint validthis: true*/
var self = this;
var email = TestHelpers.createEmail();
var password = '12345678';

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

@ -425,7 +425,6 @@ define([
});
function testRepopulateFields(dest, header) {
/*jshint validthis: true*/
var self = this;
var year = OLD_ENOUGH_YEAR;

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

@ -11,7 +11,6 @@ define([
'./tools/firefox_profile'
],
function (intern, topic, firefoxProfile) {
/*jshint maxcomplexity:11 */
/*eslint complexity: [2, 11] */
var args = intern.args;
var fxaAuthRoot = args.fxaAuthRoot || 'http://127.0.0.1:9000/v1';
@ -79,12 +78,12 @@ function (intern, topic, firefoxProfile) {
};
// to create a profile, give it the `config` option.
config.capabilities.firefox_profile = firefoxProfile(config);
config.capabilities.firefox_profile = firefoxProfile(config); //eslint-disable-line camelcase
// custom Firefox binary location, if specified then the default is ignored.
// ref: https://code.google.com/p/selenium/wiki/DesiredCapabilities#WebDriver
if (args.firefoxBinary) {
config.capabilities.firefox_binary = args.firefoxBinary;
config.capabilities.firefox_binary = args.firefoxBinary; //eslint-disable-line camelcase
}
return config;

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

@ -19,7 +19,6 @@ define([
};
function testClientJson(acceptLanguageHeader, expectedLanguage) {
/*jshint validthis: true*/
var dfd = this.async(intern.config.asyncTimeout);
var headers = {};
@ -65,7 +64,6 @@ define([
}
function testExpectHTMLResponse(url, acceptHeader) {
/*jshint validthis: true*/
var dfd = this.async(intern.config.asyncTimeout);
var headers = {};