From 641d9b3cfa2e234d9a3977ccf469d50cfd1f360d Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 27 May 2016 16:31:27 +0200 Subject: [PATCH] Update deps. Fix lint issues. --- .eslintrc | 4 +--- package.json | 6 +++--- src/_h5ai/public/js/lib/core/types.js | 2 +- src/_h5ai/public/js/lib/core/util.js | 4 ++-- src/_h5ai/public/js/lib/ext/peer5.js | 2 +- src/_h5ai/public/js/lib/model/item.js | 4 ++-- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.eslintrc b/.eslintrc index b9abad3a..9e3e8f5d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -59,6 +59,7 @@ handle-callback-err: 2 indent: [2, 4] key-spacing: [2, {beforeColon: false, afterColon: true}] + keyword-spacing: [2, {before: true, after: true}] linebreak-style: [2, unix] max-depth: [1, 4] max-len: [0, 80, 4] @@ -90,7 +91,6 @@ no-else-return: 1 no-empty: 2 no-empty-character-class: 2 - no-empty-label: 2 no-empty-pattern: 2 no-eq-null: 2 no-eval: 2 @@ -189,12 +189,10 @@ semi: 2 semi-spacing: [2, {before: false, after: true}] sort-vars: 0 - space-after-keywords: [2, always] space-before-blocks: [2, always] space-before-function-paren: [2, {anonymous: always, named: never}] space-in-parens: [2, never] space-infix-ops: 2 - space-return-throw-case: 2 space-unary-ops: [2, {words: true, nonwords: false}] spaced-comment: [2, always] strict: [2, never] diff --git a/package.json b/package.json index d9b38ed9..815c07d8 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,10 @@ "build": "npm run -s ghu release" }, "devDependencies": { - "babel-core": "6.8.0", + "babel-core": "6.9.0", "babel-eslint": "6.0.4", - "babel-preset-es2015": "6.6.0", - "eslint": "2.10.1", + "babel-preset-es2015": "6.9.0", + "eslint": "2.10.2", "ghu": "0.4.0" }, "engines": { diff --git a/src/_h5ai/public/js/lib/core/types.js b/src/_h5ai/public/js/lib/core/types.js index f66f2d68..53fdc7a6 100644 --- a/src/_h5ai/public/js/lib/core/types.js +++ b/src/_h5ai/public/js/lib/core/types.js @@ -24,7 +24,7 @@ modulejs.define('core/types', ['_', 'config'], function (_, config) { var name = slashidx >= 0 ? sequence.substr(slashidx + 1) : sequence; var result; - _.each(regexps, function (regexp, type) { + _.each(regexps, function (regexp, type) { // eslint-disable-line consistent-return if (regexps[type].test(name)) { result = type; return false; diff --git a/src/_h5ai/public/js/lib/core/util.js b/src/_h5ai/public/js/lib/core/util.js index 386aa9c5..772005a3 100644 --- a/src/_h5ai/public/js/lib/core/util.js +++ b/src/_h5ai/public/js/lib/core/util.js @@ -48,8 +48,8 @@ modulejs.define('core/util', ['_'], function (_) { return isNaN(oFxNcL) ? 1 : -1; } else if (typeof oFxNcL !== typeof oFyNcL) { // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2' - oFxNcL += ''; - oFyNcL += ''; + oFxNcL = String(oFxNcL); + oFxNcL = String(oFxNcL); } if (oFxNcL < oFyNcL) { return -1; diff --git a/src/_h5ai/public/js/lib/ext/peer5.js b/src/_h5ai/public/js/lib/ext/peer5.js index f7603604..11e7221b 100644 --- a/src/_h5ai/public/js/lib/ext/peer5.js +++ b/src/_h5ai/public/js/lib/ext/peer5.js @@ -21,7 +21,7 @@ modulejs.define('ext/peer5', ['_', '$', 'core/settings'], function (_, $, allset // attach to file items, once the DOM is ready $(function () { - $('body').on('click', '.item.file > a', function (ev) { + $('body').on('click', '.item.file > a', function (ev) { // eslint-disable-line consistent-return if (window.peer5) { ev.preventDefault(); var url = ev.currentTarget.href; diff --git a/src/_h5ai/public/js/lib/model/item.js b/src/_h5ai/public/js/lib/model/item.js index 31b6975f..ff40152f 100644 --- a/src/_h5ai/public/js/lib/model/item.js +++ b/src/_h5ai/public/js/lib/model/item.js @@ -20,7 +20,7 @@ modulejs.define('model/item', ['_', 'core/event', 'core/location', 'core/server' return sequence; } - function splitPath(sequence) { + function splitPath(sequence) { // eslint-disable-line consistent-return if (sequence === '/') { return { parent: null, @@ -55,7 +55,7 @@ modulejs.define('model/item', ['_', 'core/event', 'core/location', 'core/server' return null; } - var item = cache[href] || new Item(href); + var item = cache[href] || new Item(href); // eslint-disable-line no-use-before-define if (_.isNumber(options.time)) { item.time = options.time;