From 9d4238e5cc11397b5c2aad4e150cf14afca39d58 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 22 Jan 2020 11:53:41 +0000 Subject: [PATCH] Re-enable jshint on editor and fixup issues --- Gruntfile.js | 30 +++++++++---------- .../editor-client/src/js/settings.js | 3 +- .../src/js/ui/common/treeList.js | 6 ++-- .../@node-red/editor-client/src/js/ui/diff.js | 4 +-- .../editor-client/src/js/ui/editors/json.js | 10 +++---- .../src/js/ui/editors/markdown.js | 2 +- .../editor-client/src/js/ui/palette.js | 14 +++------ .../src/js/ui/projects/projects.js | 3 +- .../@node-red/editor-client/src/js/ui/view.js | 8 ++--- 9 files changed, 38 insertions(+), 42 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 67739afe2..1e421f62d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -80,20 +80,20 @@ module.exports = function(grunt) { //"loopfunc": true, // allow functions to be defined in loops //"sub": true // don't warn that foo['bar'] should be written as foo.bar }, - all: [ - 'Gruntfile.js', - 'red.js', - 'packages/**/*.js' - ], - core: { - files: { - src: [ - 'Gruntfile.js', - 'red.js', - 'packages/**/*.js', - ] - } - }, + // all: [ + // 'Gruntfile.js', + // 'red.js', + // 'packages/**/*.js' + // ], + // core: { + // files: { + // src: [ + // 'Gruntfile.js', + // 'red.js', + // 'packages/**/*.js', + // ] + // } + // }, nodes: { files: { src: [ 'nodes/core/*/*.js' ] @@ -101,7 +101,7 @@ module.exports = function(grunt) { }, editor: { files: { - src: [ 'editor/js/**/*.js' ] + src: [ 'packages/node_modules/@node-red/editor-client/src/js/**/*.js' ] } }, tests: { diff --git a/packages/node_modules/@node-red/editor-client/src/js/settings.js b/packages/node_modules/@node-red/editor-client/src/js/settings.js index e360cea7d..760165581 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/settings.js +++ b/packages/node_modules/@node-red/editor-client/src/js/settings.js @@ -56,8 +56,9 @@ RED.settings = (function () { if (key === "auth-tokens") { return JSON.parse(localStorage.getItem(key)); } else { + var v; try { - var v = RED.utils.getMessageProperty(userSettings,key); + v = RED.utils.getMessageProperty(userSettings,key); if (v === undefined) { v = defaultIfUndefined; } diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js index 0e391a5b8..ed04733c9 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js @@ -410,7 +410,7 @@ return; } if (container.hasClass("expanded")) { - done && done(); + if (done) { done() } return; } if (!container.hasClass("built") && (item.deferBuild || typeof item.children === 'function')) { @@ -435,7 +435,7 @@ spinner.remove(); } } - done && done(); + if (done) { done() } that._trigger("childrenloaded",null,item) } if (typeof item.children === 'function') { @@ -457,7 +457,7 @@ } else { item.treeList.childList.slideDown('fast'); } - done && done(); + if (done) { done() } } container.addClass("expanded"); } diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js b/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js index 7c5b22f26..13a157e21 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js @@ -1029,9 +1029,9 @@ RED.diff = (function() { } var localSelectDiv = $('