[Pkg-mozext-commits] [tabmixplus] 14/34: Add new Eslint rule object-curly-newline

David Prévot taffit at moszumanska.debian.org
Mon Jun 27 13:57:56 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit 12ff49d4b7dc7b3a1479d65a9ff7c2bf8aee4c51
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sat Jun 11 11:30:58 2016 +0300

    Add new Eslint rule object-curly-newline
---
 .eslintrc.js                                   |  4 ++++
 chrome/content/changecode.js                   | 12 ++++++++----
 chrome/content/dialogs/promptservice.js        | 10 ++++++----
 chrome/content/extensions/extensions.js        |  3 ++-
 chrome/content/minit/tablib.js                 |  8 +++++---
 chrome/content/preferences/bindings.xml        |  8 ++++----
 chrome/content/preferences/preferences.js      | 16 +++++++++-------
 chrome/content/preferences/shortcutsLabels.xml |  3 ++-
 chrome/content/scripts/content.js              | 24 +++++++++++++++---------
 chrome/content/session/session.js              |  6 ++++--
 chrome/content/tab/tabbrowser.xml              |  3 ++-
 chrome/content/tabmix.js                       |  6 ++++--
 chrome/content/utils.js                        |  6 ++++--
 modules/AutoReload.jsm                         | 13 ++++++++-----
 modules/ContentClick.jsm                       | 12 +++++++-----
 modules/DocShellCapabilities.jsm               |  4 +---
 modules/LinkNodeUtils.jsm                      |  8 ++------
 modules/Shortcuts.jsm                          |  6 ++++--
 18 files changed, 91 insertions(+), 61 deletions(-)

diff --git a/.eslintrc.js b/.eslintrc.js
index 5ebc827..25ae709 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -193,6 +193,10 @@ module.exports = {
     "newline-after-var": 0,
     "newline-before-return": 0,
     "newline-per-chained-call": 0,
+    "object-curly-newline": [2, {
+      "ObjectExpression": {"multiline": true},
+      "ObjectPattern": "never"
+    }],
     "object-curly-spacing": [2, "never"],
     "object-shorthand": 0, // since Firefox 33
     "one-var": 0,
diff --git a/chrome/content/changecode.js b/chrome/content/changecode.js
index ecf893c..9888306 100644
--- a/chrome/content/changecode.js
+++ b/chrome/content/changecode.js
@@ -167,8 +167,10 @@ Tabmix.changeCode = function(aParent, afnName, aOptions) {
 
   let name = afnName.split(".").pop();
   try {
-    return new ChangeCode({obj: aParent, fnName: name,
-                           fullName: afnName, options: aOptions});
+    return new ChangeCode({
+      obj: aParent, fnName: name,
+      fullName: afnName, options: aOptions
+    });
   } catch (ex) {
     console.clog(console.callerName() + " failed to change " + afnName + "\nError: " + ex.message);
     if (debugMode)
@@ -179,8 +181,10 @@ Tabmix.changeCode = function(aParent, afnName, aOptions) {
 
 Tabmix.setNewFunction = function(aObj, aName, aCode) {
   if (!Object.getOwnPropertyDescriptor(aObj, aName)) {
-    Object.defineProperty(aObj, aName, {value: aCode,
-                                        writable: true, configurable: true});
+    Object.defineProperty(aObj, aName, {
+      value: aCode,
+      writable: true, configurable: true
+    });
   } else {
     aObj[aName] = aCode;
   }
diff --git a/chrome/content/dialogs/promptservice.js b/chrome/content/dialogs/promptservice.js
index 989f214..4fcc8a6 100644
--- a/chrome/content/dialogs/promptservice.js
+++ b/chrome/content/dialogs/promptservice.js
@@ -141,10 +141,12 @@ function prompt_deinit(button) {
   // if we are not a modal use a callback function
   if (typeof window._callBackFunction == "function") {
     if (window.opener && !window.opener.closed) {
-      let returnData = {button: dialogParams.GetInt(4),
-                        checked: (dialogParams.GetInt(5) == TMP_CHECKBOX_CHECKED),
-                        label: dialogParams.GetString(5),
-                        value: dialogParams.GetInt(6)};
+      let returnData = {
+        button: dialogParams.GetInt(4),
+        checked: (dialogParams.GetInt(5) == TMP_CHECKBOX_CHECKED),
+        label: dialogParams.GetString(5),
+        value: dialogParams.GetInt(6)
+      };
       try {
         window._callBackFunction(returnData);
       } catch (ex) {
diff --git a/chrome/content/extensions/extensions.js b/chrome/content/extensions/extensions.js
index 92e094e..ab736d6 100644
--- a/chrome/content/extensions/extensions.js
+++ b/chrome/content/extensions/extensions.js
@@ -405,7 +405,8 @@ var TMP_extensionsCompatibility = {
         '  title = "(*) " + title;' +
         '$&';
 
-      let func = {styleTiledTabs: /if\s+\(tab\.hasAttribute\("tiletabs-assigned"\)\)/,
+      let func = {
+        styleTiledTabs: /if\s+\(tab\.hasAttribute\("tiletabs-assigned"\)\)/,
         showProperties: 'if (tab.hasAttribute("image"))',
         onTabAttrModified: /if\s+\(tab\.hasAttribute\("tiletabs-assigned"\)\)/,
         showTabList: /menuItem\.setAttribute\("label",\s*title\);/,
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index b4f5cfd..c0a64a7 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -1111,9 +1111,11 @@ var tablib = { // eslint-disable-line
         return gContextMenu.tabmixLinkURL;
 
       if (!isValid(linkURL)) {
-        let json = {button: 0, shiftKey: false, ctrlKey: false, metaKey: false,
-                    altKey: false, target: {},
-                    tabmix_openLinkWithHistory: true};
+        let json = {
+          button: 0, shiftKey: false, ctrlKey: false, metaKey: false,
+          altKey: false, target: {},
+          tabmix_openLinkWithHistory: true
+        };
         // we only get here when it is safe to use contentWindowAsCPOW
         // see TabmixContext.updateMainContextMenu
         let result = Tabmix.ContentClick.getParamsForLink(json,
diff --git a/chrome/content/preferences/bindings.xml b/chrome/content/preferences/bindings.xml
index 3bb6da9..28e5dbd 100644
--- a/chrome/content/preferences/bindings.xml
+++ b/chrome/content/preferences/bindings.xml
@@ -22,7 +22,8 @@
     </implementation>
   </binding>
 
-  <binding id="checkbox" extends="chrome://global/content/bindings/checkbox.xml#checkbox">
+  <binding id="checkbox"
+           extends="chrome://global/content/bindings/checkbox.xml#checkbox">
     <content>
       <xul:image class="checkbox-check" xbl:inherits="checked,disabled"/>
       <xul:hbox class="checkbox-label-box" xbl:inherits="flex=flexlabel">
@@ -30,11 +31,10 @@
         <xul:label class="checkbox-label" xbl:inherits="xbl:text=label,accesskey,crop,flex=flexlabel"/>
       </xul:hbox>
     </content>
-    <implementation>
-    </implementation>
   </binding>
 
-  <binding id="preference" extends="chrome://global/content/bindings/preferences.xml#preference">
+  <binding id="preference"
+           extends="chrome://global/content/bindings/preferences.xml#preference">
     <implementation>
       <constructor>
         <![CDATA[
diff --git a/chrome/content/preferences/preferences.js b/chrome/content/preferences/preferences.js
index bc5e145..508fbf6 100644
--- a/chrome/content/preferences/preferences.js
+++ b/chrome/content/preferences/preferences.js
@@ -35,8 +35,10 @@ var gPrefWindow = {
     var docElt = document.documentElement;
 
     // don't use browser.preferences.animateFadeIn
-    Object.defineProperty(docElt, "_shouldAnimate", {value: false,
-                          writable: true, configurable: true});
+    Object.defineProperty(docElt, "_shouldAnimate", {
+      value: false,
+      writable: true, configurable: true
+    });
     docElt.setAttribute("animated", "false");
 
     window.gIncompatiblePane.init(docElt);
@@ -271,8 +273,10 @@ function getPrefByType(prefName) {
 }
 
 function setPrefByType(prefName, newValue, atImport) {
-  let pref = {name: prefName, value: newValue,
-              type: Services.prefs.getPrefType(prefName)};
+  let pref = {
+    name: prefName, value: newValue,
+    type: Services.prefs.getPrefType(prefName)
+  };
   try {
     if (!atImport || !setPrefAfterImport(pref))
       setPref(pref);
@@ -419,9 +423,7 @@ function exportData() {
         return "\n" + pref + "=" + getPrefByType(pref);
       });
       patterns.unshift("tabmixplus");
-      OS.File.writeAtomic(file.path, patterns.join(""), {
-        encoding: "utf-8", tmpPath: file.path + ".tmp"
-      });
+      OS.File.writeAtomic(file.path, patterns.join(""), {encoding: "utf-8", tmpPath: file.path + ".tmp"});
     }
   }).then(null, Tabmix.reportError);
 }
diff --git a/chrome/content/preferences/shortcutsLabels.xml b/chrome/content/preferences/shortcutsLabels.xml
index 5cd94ec..7731eb6 100644
--- a/chrome/content/preferences/shortcutsLabels.xml
+++ b/chrome/content/preferences/shortcutsLabels.xml
@@ -7,7 +7,8 @@
 %shortcutsDTD;
 ]>
 
-<!--suppress XmlUnusedNamespaceDeclaration -->
+<!-- suppress XmlUnusedNamespaceDeclaration -->
+<!-- eslint-disable object-curly-newline -->
 <bindings id="tmp_shortcuts_labels"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
diff --git a/chrome/content/scripts/content.js b/chrome/content/scripts/content.js
index a111fdd..e0780a7 100644
--- a/chrome/content/scripts/content.js
+++ b/chrome/content/scripts/content.js
@@ -97,8 +97,10 @@ var TabmixContentHandler = {
         break;
       }
       case "Tabmix:collectScrollPosition": {
-        let scroll = {scrollX: content.scrollX,
-                      scrollY: content.scrollY};
+        let scroll = {
+          scrollX: content.scrollX,
+          scrollY: content.scrollY
+        };
         sendAsyncMessage("Tabmix:updateScrollPosition", {scroll: scroll});
         break;
       }
@@ -107,9 +109,11 @@ var TabmixContentHandler = {
         break;
       }
       case "Tabmix:collectReloadData": {
-        let json = {scrollX: content.scrollX,
-                    scrollY: content.scrollY,
-                    postData: null};
+        let json = {
+          scrollX: content.scrollX,
+          scrollY: content.scrollY,
+          postData: null
+        };
         let sh = docShell.QueryInterface(Ci.nsIWebNavigation).sessionHistory
                          .QueryInterface(Ci.nsISHistoryInternal);
         if (sh) {
@@ -217,10 +221,12 @@ TabmixClickEventHandler = {
       }
     }
 
-    let json = {button: event.button, shiftKey: event.shiftKey,
-                ctrlKey: event.ctrlKey, metaKey: event.metaKey,
-                altKey: event.altKey, href: null, title: null,
-                bookmark: false, referrerPolicy: referrerPolicy};
+    let json = {
+      button: event.button, shiftKey: event.shiftKey,
+      ctrlKey: event.ctrlKey, metaKey: event.metaKey,
+      altKey: event.altKey, href: null, title: null,
+      bookmark: false, referrerPolicy: referrerPolicy
+    };
 
     if (typeof event.tabmix_openLinkWithHistory == "boolean")
       json.tabmix_openLinkWithHistory = true;
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index 6d5f564..9200645 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -1518,8 +1518,10 @@ TabmixSessionManager = {
       case Tabmix.BUTTON_OK:
       case Tabmix.BUTTON_EXTRA1 :
         var trimResult = result.label.replace(/^[\s]+/g, "").replace(/[\s]+$/g, "");
-        return {button: result.button, name: encodeURI(trimResult),
-                path: sessionList.path[result.value], saveClosedTabs: result.checked};
+        return {
+          button: result.button, name: encodeURI(trimResult),
+          path: sessionList.path[result.value], saveClosedTabs: result.checked
+        };
     }
     return {};
   },
diff --git a/chrome/content/tab/tabbrowser.xml b/chrome/content/tab/tabbrowser.xml
index 8fe280a..8e907c3 100644
--- a/chrome/content/tab/tabbrowser.xml
+++ b/chrome/content/tab/tabbrowser.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0"?>
 
-<!--suppress XmlUnusedNamespaceDeclaration -->
+<!-- suppress XmlUnusedNamespaceDeclaration -->
+<!-- eslint-disable object-curly-newline -->
 <bindings id="DEPRECATED_tabxbindings_30"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index ef1447c..340de69 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -1163,8 +1163,10 @@ Tabmix.initialization = {
 
     delete this.isValidWindow;
     Object.defineProperty(this, "run", {enumerable: false});
-    Object.defineProperty(this, "isValidWindow", {value: !stopInitialization,
-                                                  enumerable: false});
+    Object.defineProperty(this, "isValidWindow", {
+      value: !stopInitialization,
+      enumerable: false
+    });
     return this.isValidWindow;
   },
 
diff --git a/chrome/content/utils.js b/chrome/content/utils.js
index 1499a81..49d8173 100644
--- a/chrome/content/utils.js
+++ b/chrome/content/utils.js
@@ -167,8 +167,10 @@ var Tabmix = {
     if (!modal)
       dialog._callBackFunction = aCallBack;
 
-    return {button: dpb.GetInt(4), checked: (dpb.GetInt(5) == this.CHECKBOX_CHECKED),
-            label: dpb.GetString(5), value: dpb.GetInt(6)};
+    return {
+      button: dpb.GetInt(4), checked: (dpb.GetInt(5) == this.CHECKBOX_CHECKED),
+      label: dpb.GetString(5), value: dpb.GetInt(6)
+    };
   },
 
   windowEnumerator: function Tabmix_windowEnumerator(aWindowtype) {
diff --git a/modules/AutoReload.jsm b/modules/AutoReload.jsm
index d444572..5e150ab 100644
--- a/modules/AutoReload.jsm
+++ b/modules/AutoReload.jsm
@@ -317,8 +317,10 @@ function _reloadTab(aTab) {
 }
 
 function doReloadTab(window, browser, data) {
-  browser.__tabmixScrollPosition = {x: data.scrollX,
-                                    y: data.scrollY};
+  browser.__tabmixScrollPosition = {
+    x: data.scrollX,
+    y: data.scrollY
+  };
   var loadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY |
                               Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY |
                               Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE;
@@ -345,9 +347,10 @@ function doReloadTab(window, browser, data) {
   let windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor)
                           .getInterface(Ci.nsIDOMWindowUtils);
 
-  browser.messageManager.sendAsyncMessage("Browser:Reload",
-      {flags: loadFlags,
-        handlingUserInput: windowUtils.isHandlingUserInput});
+  browser.messageManager.sendAsyncMessage("Browser:Reload", {
+    flags: loadFlags,
+    handlingUserInput: windowUtils.isHandlingUserInput
+  });
 }
 
 function _observe(aSubject, aTopic) {
diff --git a/modules/ContentClick.jsm b/modules/ContentClick.jsm
index 39df08d..62c4f3d 100644
--- a/modules/ContentClick.jsm
+++ b/modules/ContentClick.jsm
@@ -119,11 +119,13 @@ ContentClickInternal = {
 
       let suppressTabsOnFileDownload =
           json.tabmixContentClick.suppressTabsOnFileDownload || false;
-      let params = {charset: browser.characterSet,
-                    suppressTabsOnFileDownload: suppressTabsOnFileDownload,
-                    referrerURI: browser.documentURI,
-                    referrerPolicy: json.referrerPolicy,
-                    noReferrer: json.noReferrer};
+      let params = {
+        charset: browser.characterSet,
+        suppressTabsOnFileDownload: suppressTabsOnFileDownload,
+        referrerURI: browser.documentURI,
+        referrerPolicy: json.referrerPolicy,
+        noReferrer: json.noReferrer
+      };
       window.openLinkIn(json.href, where, params);
 
       try {
diff --git a/modules/DocShellCapabilities.jsm b/modules/DocShellCapabilities.jsm
index e6e1d51..99b9fd3 100644
--- a/modules/DocShellCapabilities.jsm
+++ b/modules/DocShellCapabilities.jsm
@@ -20,9 +20,7 @@ this.DocShellCapabilities = {
 
   update: function(browser, data) {
     // Update the persistent tab state cache
-    TabStateCache.update(browser, {
-      disallow: data.disallow || null
-    });
+    TabStateCache.update(browser, {disallow: data.disallow || null});
     if (data.reload)
       browser.reload();
   },
diff --git a/modules/LinkNodeUtils.jsm b/modules/LinkNodeUtils.jsm
index cdbe61a..3b704fa 100644
--- a/modules/LinkNodeUtils.jsm
+++ b/modules/LinkNodeUtils.jsm
@@ -33,12 +33,8 @@ this.LinkNodeUtils = {
       ownerDocument: {
         URL: doc.URL,
         documentURI: doc.documentURI,
-        defaultView: {
-          frameElement: Boolean(doc.defaultView.frameElement)
-        },
-        location: {
-          href: doc.location ? doc.location.href : ""
-        }
+        defaultView: {frameElement: Boolean(doc.defaultView.frameElement)},
+        location: {href: doc.location ? doc.location.href : ""}
       },
       parentNode: {
         baseURI: node.parentNode.baseURI,
diff --git a/modules/Shortcuts.jsm b/modules/Shortcuts.jsm
index 6bf02b4..c295559 100644
--- a/modules/Shortcuts.jsm
+++ b/modules/Shortcuts.jsm
@@ -497,8 +497,10 @@ KeyConfig = {
     else if (/^!/.test(prefValue))
       newValue = "d&";
     else {
-      let newKey = {modifiers: prefValue[0].replace(" ", ","),
-          key: prefValue[1], keycode: prefValue[2]};
+      let newKey = {
+        modifiers: prefValue[0].replace(" ", ","),
+        key: prefValue[1], keycode: prefValue[2]
+      };
       if (keyData.value.indexOf("accel") > -1)
         newKey.modifiers = newKey.modifiers.replace(getPlatformAccel(), "accel");
       newValue = Shortcuts.keyStringify(newKey);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list