Skip to content

Commit

Permalink
Fix a lot of lint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
mythmon committed Jul 29, 2015
1 parent eb5b032 commit f62471b
Show file tree
Hide file tree
Showing 74 changed files with 693 additions and 949 deletions.
5 changes: 0 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
rules:
# Turning on extra rules
quotes: [2, "single", "avoid-escape"]
no-shadow: [2, {"hoist": "all"}]
no-alert: [2]
no-use-before-define: [2, "nofunc"]
space-before-blocks: [2, "always"]
space-after-keywords: [2]
block-scoped-var: [2]
dot-location: [2, "property"]
wrap-iife: [2, "inside"]
brace-style: [2, "1tbs", {"allowSingleLine": true}]
Expand All @@ -17,9 +15,6 @@ rules:
no-this-before-super: [2]
constructor-super: [2]

# Turn on extra warnings
prefer-const: [1]

# Turning off default rules. Should some of these be warnings?
no-console: [0]
no-unused-vars: [0]
Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-env node */
var gulp = require('gulp');
var nunjucks = require('gulp-nunjucks');
var watch = require('gulp-watch');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* globals k:false, _:false, React:true, $:false */
import ContributorsList from './ContributorsList.jsx';

export default class ContributorsController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ controller.render();

window.onpopstate = function() {
controller.refresh();
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ var controller = new CommunityController({
transform: (timestamp) => <RelativeTime timestamp={timestamp} future={false}/>
},
],
})
});

controller.render();

window.onpopstate = function() {
controller.refresh();
}
};
1 change: 1 addition & 0 deletions kitsune/community/static/community/js/select.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global $:false */
$(function() {
var selectTrigger = $('.ts-select-trigger');
var options = $('.ts-options');
Expand Down
40 changes: 20 additions & 20 deletions kitsune/sumo/static/sumo/js/aaq.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*globals console, BrowserDetect, gettext*/
/* globals BrowserDetect:false, gettext:false, remoteTroubleshooting:false, jQuery:false */
/*
* Prepopulate system info in AAQ form
*/

(function($) {

"use strict";
'use strict';

function AAQSystemInfo($form) {
AAQSystemInfo.prototype.init.call(this, $form);
Expand All @@ -21,23 +21,23 @@ AAQSystemInfo.prototype = {

// Only guess at OS, FF version, plugins if we are on the desktop
// asking a firefox desktop question (or s/desktop/mobile/).
if((BrowserDetect.browser === 'fx' && self.isDesktopFF()) ||
if ((BrowserDetect.browser === 'fx' && self.isDesktopFF()) ||
(BrowserDetect.browser === 'm' && self.isMobileFF()) ||
(BrowserDetect.browser === 'fxos' && self.isFirefoxOS())) {
$input = $form.find('input[name="os"]');
if(!$input.val()) {
if (!$input.val()) {
$input.val(self.getOS());
}
$input = $form.find('input[name="ff_version"]');
if(!$input.val()) {
if (!$input.val()) {
$input.val(self.getFirefoxVersion());
}
$input = $form.find('input[name="device"]');
if(!$input.val()) {
if (!$input.val()) {
$input.val(self.getDevice());
}
$input = $form.find('textarea[name="plugins"]');
if(!$input.val()) {
if (!$input.val()) {
$input.val(self.getPlugins());
}
}
Expand Down Expand Up @@ -97,7 +97,7 @@ AAQSystemInfo.prototype = {
],
ua = navigator.userAgent,
i, l;
for (i=0, l=os.length; i<l; i++) {
for (i = 0, l = os.length; i < l; i++) {
if (os[i][1].test(ua)) {
return os[i][0];
}
Expand All @@ -109,15 +109,15 @@ AAQSystemInfo.prototype = {
var plugins = [],
i, d;
for (i = 0; i < navigator.plugins.length; i++) {
d = navigator.plugins[i].description.replace(/<[^>]+>/ig,'');
if (plugins.indexOf(d) == -1) {
d = navigator.plugins[i].description.replace(/<[^>]+>/ig, '');
if (plugins.indexOf(d) === -1) {
plugins.push(d);
}
}
if (plugins.length > 0) {
plugins = "* " + plugins.join("\n* ");
plugins = '* ' + plugins.join('\n* ');
} else {
plugins = "";
plugins = '';
}
return plugins;
},
Expand Down Expand Up @@ -153,7 +153,9 @@ AAQSystemInfo.prototype = {
var self = this;
var browserData;

if (addEvent === undefined) addEvent = true;
if (addEvent === undefined) {
addEvent = true;
}

// If the troubleshoot input exists, try to get the data.
if ($('#id_troubleshooting').length === 0) {
Expand Down Expand Up @@ -185,12 +187,10 @@ AAQSystemInfo.prototype = {
window.mozTroubleshoot.snapshotJSON(function(json) {
handleData(JSON.parse(json));
});
} else {
if (addEvent) {
// Well, the user might install it later, so set up a listener.
window.addEventListener('mozTroubleshootDidBecomeAvailable',
self.getTroubleshootingInfo.bind(self, false));
}
} else if (addEvent) {
// Well, the user might install it later, so set up a listener.
window.addEventListener('mozTroubleshootDidBecomeAvailable',
self.getTroubleshootingInfo.bind(self, false));
}
}
});
Expand All @@ -206,7 +206,7 @@ AAQSystemInfo.prototype = {
}
// The last two parameters cause this to pretty print,
// in case anyone looks at it.
data = JSON.stringify(data, null, " ");
data = JSON.stringify(data, null, ' ');
$('#addon-section').remove();
$('#api-section').remove();
$('#id_troubleshooting').val(data);
Expand Down
Loading

0 comments on commit f62471b

Please sign in to comment.