You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2016/01/26 20:11:54 UTC

[23/24] allura git commit: [#8035] ESLINT FIX: no-unused-var (allow unused function params)

[#8035] ESLINT FIX: no-unused-var  (allow unused function params)


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e828e51a
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e828e51a
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e828e51a

Branch: refs/heads/hs/8035
Commit: e828e51a5b03e781272638dcbe3d6744664d8278
Parents: fed5f1c
Author: Heith Seewald <he...@gmail.com>
Authored: Tue Jan 26 14:09:18 2016 -0500
Committer: Heith Seewald <he...@gmail.com>
Committed: Tue Jan 26 14:11:06 2016 -0500

----------------------------------------------------------------------
 .eslintrc-es6                                  | 10 +++-
 Allura/allura/public/nf/js/context-menu.es6.js | 20 ++++----
 Allura/allura/public/nf/js/navbar.es6.js       |  6 +--
 Allura/allura/public/nf/js/tooltip.es6.js      | 54 ++++++++++-----------
 4 files changed, 46 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/e828e51a/.eslintrc-es6
----------------------------------------------------------------------
diff --git a/.eslintrc-es6 b/.eslintrc-es6
index 455b95a..b91ed8f 100644
--- a/.eslintrc-es6
+++ b/.eslintrc-es6
@@ -11,6 +11,10 @@
         "ClassDeclaration": false
       }
     }],
+    "no-unused-vars": [2, {
+      "vars": "local",
+      "args": "none"
+    }],
     "no-inline-comments": 0,
     "comma-dangle": 0
   },
@@ -22,15 +26,19 @@
     "_": true,
     "ReactReorderable": true
   },
-  "parser": "babel-eslint",
   "env": {
     "es6": true,
+    "jquery": true,
     "browser": true
   },
   "extends": "google",
   "ecmaFeatures": {
     "jsx": true,
     "forOf": true,
+    "blockBindings": true,
+    "arrowFunctions": true,
+    "classes": true,
+    "defaultParams": true,
     "experimentalObjectRestSpread": true
   },
   "plugins": [

http://git-wip-us.apache.org/repos/asf/allura/blob/e828e51a/Allura/allura/public/nf/js/context-menu.es6.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/context-menu.es6.js b/Allura/allura/public/nf/js/context-menu.es6.js
index 4c2958d..c03d699 100644
--- a/Allura/allura/public/nf/js/context-menu.es6.js
+++ b/Allura/allura/public/nf/js/context-menu.es6.js
@@ -24,16 +24,6 @@ class ContextMenu extends React.Component {
         super(props);
     }
 
-    static propTypes = {
-        classes: React.PropTypes.array,
-        items: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
-        onOptionClick: React.PropTypes.func.isRequired
-    };
-
-    static defaultProps = {
-        classes: []
-    };
-
     componentWillMount() {
         let _this = this;
         var mount_point;
@@ -78,4 +68,12 @@ class ContextMenu extends React.Component {
     }
 }
 
-module.exports(ContextMenu);
+ContextMenu.propTypes = {
+    classes: React.PropTypes.array,
+    items: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
+    onOptionClick: React.PropTypes.func.isRequired
+};
+
+ContextMenu.defaultProps = {
+    classes: []
+};

http://git-wip-us.apache.org/repos/asf/allura/blob/e828e51a/Allura/allura/public/nf/js/navbar.es6.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/navbar.es6.js b/Allura/allura/public/nf/js/navbar.es6.js
index f82ee97..d027602 100644
--- a/Allura/allura/public/nf/js/navbar.es6.js
+++ b/Allura/allura/public/nf/js/navbar.es6.js
@@ -17,13 +17,13 @@
        under the License.
 */
 /* eslint camelcase: 0 */
-/* exported Main */
+/* eslint no-unused-vars: [2, {"args": "none", "varsIgnorePattern": "Main"}] */
 'use strict';
 
 /**
 * Gets the current project url.
 * @param {boolean} rest - Return a "rest" version of the url.
-* @returns {string} - Project Url
+* @return {string} - Project Url
 */
 var _getProjectUrl = function(rest = true) {
     var nbhd;
@@ -584,5 +584,3 @@ var Main = React.createClass({
         );
     }
 });
-
-module.exports(Main);

http://git-wip-us.apache.org/repos/asf/allura/blob/e828e51a/Allura/allura/public/nf/js/tooltip.es6.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/tooltip.es6.js b/Allura/allura/public/nf/js/tooltip.es6.js
index f24fc16..b76a15c 100644
--- a/Allura/allura/public/nf/js/tooltip.es6.js
+++ b/Allura/allura/public/nf/js/tooltip.es6.js
@@ -16,8 +16,8 @@
        specific language governing permissions and limitations
        under the License.
 */
-'use strict';
 
+/* exported ToolTip */
 /**
  * React Tooltip (tooltipster) Base class
 
@@ -28,32 +28,6 @@ class ToolTip extends React.Component {
         super(props);
     }
 
-    static propTypes = {
-        targetSelector: React.PropTypes.string.isRequired,
-        animation: React.PropTypes.string,
-        speed: React.PropTypes.number,
-        position: React.PropTypes.string,
-        contentAsHTML: React.PropTypes.bool,
-        delay: React.PropTypes.number,
-        theme: React.PropTypes.string,
-        maxWidth: React.PropTypes.number,
-        trigger: React.PropTypes.string,
-        multiple: React.PropTypes.bool,
-    };
-
-    static defaultProps = {
-        animation: 'fade',
-        speed: 150,
-        delay: 0,
-        maxWidth: 300,
-        multiple: true,
-        contentAsHTML: false,
-        position: 'left',
-        trigger: 'hover',
-        classes: [],
-        theme: 'tooltipster-light'
-    };
-
     componentDidMount() {
         var _this = this;
         $(this.props.targetSelector).tooltipster({
@@ -75,5 +49,29 @@ class ToolTip extends React.Component {
     }
 }
 
-module.exports(ToolTip);
+ToolTip.propTypes = {
+    targetSelector: React.PropTypes.string.isRequired,
+    animation: React.PropTypes.string,
+    speed: React.PropTypes.number,
+    position: React.PropTypes.string,
+    contentAsHTML: React.PropTypes.bool,
+    delay: React.PropTypes.number,
+    theme: React.PropTypes.string,
+    maxWidth: React.PropTypes.number,
+    trigger: React.PropTypes.string,
+    multiple: React.PropTypes.bool,
+};
+
+ToolTip.defaultProps = {
+    animation: 'fade',
+    speed: 150,
+    delay: 0,
+    maxWidth: 300,
+    multiple: true,
+    contentAsHTML: false,
+    position: 'left',
+    trigger: 'hover',
+    classes: [],
+    theme: 'tooltipster-light'
+};