Lint a few more things, fix some warnings+errors

This commit is contained in:
Peter deHaan 2017-11-22 18:52:54 -08:00
Родитель 68915f9a8d
Коммит 9eed94c818
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: F0FC6C01C6305097
7 изменённых файлов: 28 добавлений и 16 удалений

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

@ -1 +1,5 @@
addon/StudyUtils.jsm
dist
OLD
package-lock.json
!.eslintrc.js

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

@ -1,3 +1,5 @@
/* eslint-env node */
"use strict";
/* All Mozilla specific rules and enviroments at:
@ -6,15 +8,15 @@
module.exports = {
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module",
"ecmaFeatures": {
"jsx": false,
"experimentalObjectRestSpread": true
}
"ecmaVersion": 8,
"sourceType": "module",
"ecmaFeatures": {
"jsx": false,
"experimentalObjectRestSpread": true,
},
},
env: {
'es6': true,
"es6": true,
// 'browser-window': false
},
@ -28,7 +30,7 @@ module.exports = {
plugins: [
"json",
"mozilla"
"mozilla",
],
rules: {

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

@ -98,6 +98,7 @@ class Feature {
label: "Thanks!",
isDefault: true,
callback: function acceptButton() {
// eslint-disable-next-line no-console
console.log("clicked THANKS!");
feature.telemetry({
event: "introduction-accept",
@ -107,6 +108,7 @@ class Feature {
{
label: "I do not want this.",
callback: function leaveStudyButton() {
// eslint-disable-next-line no-console
console.log("clicked NO!");
feature.telemetry({
event: "introduction-leave-study",

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

@ -1,3 +1,5 @@
/* eslint no-console:off */
"use strict";
/** `background.js` example for embedded webExtensions.

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

@ -61,7 +61,7 @@
},
"scripts": {
"build": "bash ./bin/xpi.sh",
"eslint": "eslint addon test --ext jsm --ext js --ext json",
"eslint": "eslint . --ext jsm --ext js --ext json",
"lint": "npm-run-all lint:*",
"lint:addons-linter": "# actually a post build test: bin/addonLintTest ' + require('./package.json').name",
"lint:eslint": "npm eslint",

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

@ -1,4 +1,5 @@
/* eslint-env node */
/* eslint no-console:off */
/* This file is a helper script that will install the extension from the .xpi
* file and setup useful preferences for debugging. This is the same setup
@ -18,7 +19,7 @@ const {
installAddon,
promiseSetupDriver,
promiseUrlBar,
MODIFIER_KEY
MODIFIER_KEY,
} = require("./test/utils");
@ -41,9 +42,9 @@ Future will clean up this interface a bit!
`;
const minimistHandler = {
boolean: [ 'help' ],
alias: { h: 'help', v: 'version' },
'--': true,
boolean: [ "help" ],
alias: { h: "help", v: "version" },
"--": true,
};
@ -62,7 +63,7 @@ const minimistHandler = {
// install the addon
if (process.env.XPI) {
const fileLocation = path.join(process.cwd(), process.env.XPI);
console.log(fileLocation)
console.log(fileLocation);
await installAddon(driver, fileLocation);
console.log("Load temporary addon.");
}
@ -78,6 +79,6 @@ const minimistHandler = {
await urlBar.sendKeys(openBrowserConsole);
} catch (e) {
console.error(e); // eslint-disable-line no-console
console.error(e);
}
})();

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

@ -1,4 +1,6 @@
/* eslint-env node */
/* eslint no-console:off */
// The geckodriver package downloads and installs geckodriver for us.
// We use it by requiring it.
require("geckodriver");
@ -77,7 +79,6 @@ module.exports.promiseSetupDriver = async() => {
.forBrowser("firefox")
.setFirefoxOptions(options);
//
const binaryLocation = await promiseActualBinary(process.env.FIREFOX_BINARY || "nightly");
// console.log(binaryLocation);