diff --git a/.eslintrc.js b/.eslintrc.js index 618576a..6893651 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,7 +16,7 @@ module.exports = { ], overrides: [ { - files: "src/**", + files: "webExtensionApis/**", env: { browser: true, webextensions: true, @@ -40,14 +40,22 @@ module.exports = { "comma-dangle": ["error", "always-multiline"], eqeqeq: "error", indent: ["warn", 2, { SwitchCase: 1 }], + "max-len": [ + "warn", + { + code: 80, + ignoreComments: true, + ignoreTrailingComments: true, + ignoreUrls: true, + }, + ], "no-console": "warn", - "no-var": "error", "no-shadow": "error", "no-unused-vars": "error", + "no-var": "error", "prefer-const": "warn", "prefer-spread": "error", semi: ["error", "always"], "valid-jsdoc": "warn", - "max-len": ["warn", 80], }, }; diff --git a/package.json b/package.json index f77aa61..2d9ab78 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "scripts": { "build": "cd webExtensionApis/study && webpack", "docformat": "doctoc --title '**Contents**' docs/*.md && prettier '**/*.md' --write", - "eslint": "eslint src --ext jsm --ext js --ext json", + "eslint": "eslint webExtensionApis --ext jsm --ext js --ext json", "eslint-fix": "npm run eslint -- --fix", "format": "prettier '**/*.{css,js,jsm,json,md}' --trailing-comma=all --ignore-path=.eslintignore --write", "lint": "npm-run-all lint:*", diff --git a/webExtensionApis/prefs/api.js b/webExtensionApis/prefs/api.js index aef5915..c9d5791 100644 --- a/webExtensionApis/prefs/api.js +++ b/webExtensionApis/prefs/api.js @@ -1,7 +1,10 @@ "use strict"; +/* global ExtensionAPI:false */ + ChromeUtils.import("resource://gre/modules/Services.jsm"); +/* const PREFERENCES_PREFIX = ""; function get(key, type = "char") { @@ -32,6 +35,7 @@ function set(key, type, value) { } throw new Error(`Unknown type: ${type}`); } +*/ /* https://firefox-source-docs.mozilla.org/toolkit/components/extensions/webextensions/functions.html */ this.prefs = class extends ExtensionAPI { diff --git a/webExtensionApis/study/src/jsonschema.js b/webExtensionApis/study/src/jsonschema.js index 45b44a9..95d60ba 100644 --- a/webExtensionApis/study/src/jsonschema.js +++ b/webExtensionApis/study/src/jsonschema.js @@ -1,3 +1,5 @@ +/* eslint-env commonjs */ + const Ajv = require("ajv/dist/ajv.min.js"); const ajv = new Ajv(); diff --git a/webExtensionApis/study/src/studyUtilsBootstrap.js b/webExtensionApis/study/src/studyUtilsBootstrap.js index ff419f6..db23fe4 100644 --- a/webExtensionApis/study/src/studyUtilsBootstrap.js +++ b/webExtensionApis/study/src/studyUtilsBootstrap.js @@ -72,7 +72,7 @@ this.Bootstrap = function(studySetup, studyUtils) { studySetup.addon = { id, version }; studyUtils.setup(studySetup); // TODO bdanforth: patch studyUtils to setLoggingLevel as part of setup method - //studyUtils.setLoggingLevel(...); + // studyUtils.setLoggingLevel(...); }, // choose the variation for this particular user, then set it.