Bug 1263637 - Fix eslint 2 warnings for WebExtensions code. r=kmag
authorBob Silverberg <bsilverberg@mozilla.com>
Mon, 18 Apr 2016 09:08:05 -0400
changeset 293760 72da827dde30b4c3cff2b6785a785b3a4284daa9
parent 293759 f271329c8fef6bedb9f52030d4fecf0632e18c36
child 293761 e2f5cd553b44f73fa85c8427aed560f9a47f0ce9
push id30193
push usercbook@mozilla.com
push dateWed, 20 Apr 2016 09:47:15 +0000
treeherdermozilla-central@973dfa158221 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1263637
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1263637 - Fix eslint 2 warnings for WebExtensions code. r=kmag MozReview-Commit-ID: CNLX3xjIoNV
python/mach_commands.py
testing/docker/lint/Dockerfile
toolkit/components/extensions/.eslintrc
toolkit/components/extensions/Schemas.jsm
--- a/python/mach_commands.py
+++ b/python/mach_commands.py
@@ -269,17 +269,17 @@ class MachCommands(MachCommandBase):
         npmPath = self.getNodeOrNpmPath("npm")
         if not npmPath:
             return 1
 
         # Install eslint 1.10.3.
         # Note that that's the version currently compatible with the mozilla
         # eslint plugin.
         success = self.callProcess("eslint",
-                                   [npmPath, "install", "eslint@2.7.0", "-g"])
+                                   [npmPath, "install", "eslint@2.8.0", "-g"])
         if not success:
             return 1
 
         # Install eslint-plugin-mozilla.
         success = self.callProcess("eslint-plugin-mozilla",
                                    [npmPath, "link"],
                                    "testing/eslint-plugin-mozilla")
         if not success:
--- a/testing/docker/lint/Dockerfile
+++ b/testing/docker/lint/Dockerfile
@@ -1,17 +1,17 @@
 FROM          node:4.2
 MAINTAINER    Dave Townsend <dtownsend@oxymoronical.com>
 
 RUN useradd -d /home/worker -s /bin/bash -m worker
 WORKDIR /home/worker
 
 # install necessary npm packages
 RUN           npm install -g taskcluster-vcs@2.3.12
-RUN           npm install -g eslint@2.7.0
+RUN           npm install -g eslint@2.8.0
 RUN           npm install -g eslint-plugin-html@1.4.0
 RUN           npm install -g eslint-plugin-react@4.2.3
 
 # Set variable normally configured at login, by the shells parent process, these
 # are taken from GNU su manual
 ENV           HOME          /home/worker
 ENV           SHELL         /bin/bash
 ENV           USER          worker
--- a/toolkit/components/extensions/.eslintrc
+++ b/toolkit/components/extensions/.eslintrc
@@ -423,17 +423,17 @@
 
     // Disallow padding within blocks.
     "padded-blocks": [1, "never"],
 
     // Don't require quotes around object literal property names.
     "quote-props": 0,
 
     // Double quotes should be used.
-    "quotes": [1, "double", "avoid-escape"],
+    "quotes": [1, "double", {"avoidEscape": true, "allowTemplateLiterals": true}],
 
     // Require use of the second argument for parseInt().
     "radix": 2,
 
     // Enforce spacing after semicolons.
     "semi-spacing": [2, {"before": false, "after": true}],
 
     // Don't require to sort variables within the same declaration block.
--- a/toolkit/components/extensions/Schemas.jsm
+++ b/toolkit/components/extensions/Schemas.jsm
@@ -540,17 +540,18 @@ class ObjectType extends Type {
 
     return this;
   }
 
   checkBaseType(baseType) {
     return baseType == "object";
   }
 
-  normalize(value, context) {
+  // FIXME: Bug 1265371 - Refactor normalize and parseType in Schemas.jsm to reduce complexity
+  normalize(value, context) { // eslint-disable-line complexity
     let v = this.normalizeBase("object", value, context);
     if (v.error) {
       return v;
     }
     value = v.value;
 
     if (this.isInstanceOf) {
       if (Object.keys(this.properties).length ||
@@ -1065,17 +1066,18 @@ this.Schemas = {
     let ns = this.namespaces.get(namespaceName);
     if (!ns) {
       ns = new Map();
       this.namespaces.set(namespaceName, ns);
     }
     ns.set(symbol, value);
   },
 
-  parseType(path, type, extraProperties = []) {
+  // FIXME: Bug 1265371 - Refactor normalize and parseType in Schemas.jsm to reduce complexity
+  parseType(path, type, extraProperties = []) { // eslint-disable-line complexity
     let allowedProperties = new Set(extraProperties);
 
     // Do some simple validation of our own schemas.
     function checkTypeProperties(...extra) {
       let allowedSet = new Set([...allowedProperties, ...extra, "description", "deprecated", "preprocess"]);
       for (let prop of Object.keys(type)) {
         if (!allowedSet.has(prop)) {
           throw new Error(`Internal error: Namespace ${path.join(".")} has invalid type property "${prop}" in type "${type.id || JSON.stringify(type)}"`);