Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix #3450: Re-enable eslint-plugin-mozilla now that it is fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Standard8 committed Sep 19, 2017
1 parent bb3592e commit 73d4077
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 27 deletions.
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ static/vendor
/build
/addon/webextension/build
/firefox
# TODO: reenable once mozilla/browser-test plugin is working:
/test/addon/browser_screenshots_ui_check.js
5 changes: 2 additions & 3 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:

extends:
- eslint:recommended
#- plugin:mozilla/recommended
- plugin:mozilla/recommended
- plugin:react/recommended

parserOptions:
Expand All @@ -14,7 +14,7 @@ parserOptions:
jsx: true

plugins:
#- mozilla
- mozilla
- react
- promise

Expand All @@ -34,7 +34,6 @@ rules:
no-var: off # TODO: change to "error"
prefer-const: off # TODO: change to "error"
quotes: [off, double] # TODO: change to "error"
no-unused-vars: off # TODO: change to "error"

promise/always-return: off
promise/avoid-new: off
Expand Down
2 changes: 0 additions & 2 deletions addon/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* globals ADDON_DISABLE */
// TODO: re-enable
/* eslint-disable */
const OLD_ADDON_PREF_NAME = "extensions.jid1-NeEaf3sAHdKHPA@jetpack.deviceIdInfo";
const OLD_ADDON_ID = "jid1-NeEaf3sAHdKHPA@jetpack";
const ADDON_ID = "screenshots@mozilla.org";
Expand Down
6 changes: 3 additions & 3 deletions addon/webextension/background/takeshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ this.takeshot = (function() {
let enc = new TextEncoder("utf-8");
body = enc.encode(body);
body = concatBuffers(body.buffer, blobAsBuffer);
let tail = "\r\n" + "--" + boundary + "--";
let tail = `\r\n--${boundary}--`;
tail = enc.encode(tail);
body = concatBuffers(body, tail.buffer);
return {
Expand All @@ -199,12 +199,12 @@ this.takeshot = (function() {
{shot: JSON.stringify(shot.asJson())},
"blob", "screenshot.png", blob
);
} else {
}
return {
"content-type": "application/json",
body: JSON.stringify(shot.asJson())
};
}

}).then((submission) => {
headers["content-type"] = submission["content-type"];
sendEvent("upload", "started", {eventValue: Math.floor(submission.body.length / 1000)});
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ machine:
services:
- docker
node:
version: 6.10.0
version: 8.2.0
environment:
RDS_NAME: circle_test
RDS_USERNAME: ubuntu
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"csurf": "1.9.0",
"envc": "2.5.0",
"escape-html": "1.0.3",
"eslint-plugin-no-unsanitized": "2.0.1",
"express": "4.15.4",
"fluent": "0.4.1",
"fluent-intl-polyfill": "0.1.0",
Expand Down Expand Up @@ -57,8 +56,9 @@
"browserify": "14.4.0",
"david": "11.0.0",
"envify": "4.1.0",
"eslint": "4.5.0",
"eslint-plugin-mozilla": "0.4.3",
"eslint": "4.7.1",
"eslint-plugin-mozilla": "0.4.4",
"eslint-plugin-no-unsanitized": "2.0.1",
"eslint-plugin-promise": "3.5.0",
"eslint-plugin-react": "^7.3.0",
"fx-runner": "1.0.7",
Expand Down
2 changes: 1 addition & 1 deletion server/src/pages/shotindex/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports.launch = function(m) {
return;
}
let authTimeout = setTimeout(() => {
// eslint-disable-next-line no-global-assign
// eslint-disable-next-line no-global-assign, no-native-reassign
location = location.origin + "/#tour";
}, FIVE_SECONDS);
window.wantsauth.addAuthDataListener((data) => {
Expand Down
2 changes: 1 addition & 1 deletion server/src/ravenclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports.sendRavenMessage = function(req, message, options) {
options.extra.path = req.originalUrl;
options.extra.method = req.method;
options.extra.userAgent = req.headers['user-agent'];
options.extra.referrer = req.headers['referer'];
options.extra.referrer = req.headers.referer;
options.extra.authenticated = !!req.deviceId;
Raven.captureMessage(message, options);
};
Expand Down
6 changes: 3 additions & 3 deletions server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,8 @@ app.get("/images/:imageid", function(req, res) {
notFound(req, res);
} else {
let localReferrer = false;
if (req.headers["referer"]) {
localReferrer = req.headers["referer"].startsWith(req.backend);
if (req.headers.referer) {
localReferrer = req.headers.referer.startsWith(req.backend);
}
if (!localReferrer) {
let hasher = require("crypto").createHash("sha1");
Expand All @@ -821,7 +821,7 @@ app.get("/images/:imageid", function(req, res) {
analytics.pageview({
dp: analyticsUrl,
dh: req.backend,
documentReferrer: req.headers["referer"],
documentReferrer: req.headers.referer,
ua: req.headers["user-agent"]
}).event({
ec: "web",
Expand Down
9 changes: 2 additions & 7 deletions test/addon/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
env:
node: true

# TODO: re-enable
#extends:
# - plugin:mozilla/browser-test

rules:
no-unused-vars: off
no-undef: off
extends:
- plugin:mozilla/browser-test
1 change: 0 additions & 1 deletion test/addon/browser_screenshots_ui_check.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint disable */
"use strict";

const BUTTON_ID = "pageAction-panel-screenshots";
Expand Down

0 comments on commit 73d4077

Please sign in to comment.