From 989c7147cbf3b373b2270e53d5fdac9ad4d22ee2 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 18 May 2018 18:40:14 +0100 Subject: [PATCH] lint catch es6 escapes in core nodes to fix twitter node and sqlite node --- .jshintrc | 4 ++-- social/twitter/27-twitter.js | 4 +++- social/twitter/package.json | 2 +- storage/sqlite/package.json | 2 +- storage/sqlite/sqlite.js | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.jshintrc b/.jshintrc index 81998b32..fd6da821 100644 --- a/.jshintrc +++ b/.jshintrc @@ -14,6 +14,6 @@ //"expr": true, // allow ternery operator syntax... "shadow": true, // allow variable shadowing (re-use of names...) "sub": true, // don't warn that foo['bar'] should be written as foo.bar - "proto": true, // allow setting of __proto__ in node < v0.12 - "esversion": 6 // allow es6 + "proto": true // allow setting of __proto__ in node < v0.12 + /* "esversion": 6 // allow es6 */ } diff --git a/social/twitter/27-twitter.js b/social/twitter/27-twitter.js index 01f20a06..aea485c9 100644 --- a/social/twitter/27-twitter.js +++ b/social/twitter/27-twitter.js @@ -401,7 +401,9 @@ module.exports = function(RED) { if (msg.payload.slice(0,2) == "D ") { // direct message syntax: "D user message" - [dm_user,msg.payload]=msg.payload.match(/D\s+(\S+)\s+(.*)/).slice(1); + var t = msg.payload.match(/D\s+(\S+)\s+(.*)/).slice(1); + dm_user = t[0]; + msg.payload = t[1]; } if (msg.payload.length > 280) { msg.payload = msg.payload.slice(0,279); diff --git a/social/twitter/package.json b/social/twitter/package.json index 7a4f2b88..96fd4796 100644 --- a/social/twitter/package.json +++ b/social/twitter/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-twitter", - "version" : "0.1.13", + "version" : "0.1.14", "description" : "A Node-RED node to talk to Twitter", "dependencies" : { "twitter-ng": "0.6.2", diff --git a/storage/sqlite/package.json b/storage/sqlite/package.json index 6a77754f..e00c270f 100644 --- a/storage/sqlite/package.json +++ b/storage/sqlite/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-sqlite", - "version": "0.2.1", + "version": "0.2.2", "description": "A sqlite node for Node-RED", "dependencies": { "sqlite3": "^4.0.0" diff --git a/storage/sqlite/sqlite.js b/storage/sqlite/sqlite.js index e210bbcb..73d2ad21 100644 --- a/storage/sqlite/sqlite.js +++ b/storage/sqlite/sqlite.js @@ -95,11 +95,11 @@ module.exports = function(RED) { } if (typeof msg.params == "undefined"){ node.error("msg.params not passed"); - node.status({fill:"red",shape:"dot",text:"msg.params not passed",msg}); + node.status({fill:"red",shape:"dot",text:"msg.params not defined"}); } else if (typeof msg.params != "object"){ node.error("msg.params not an object"); - node.status({fill:"red",shape:"dot",text:"msg.params not an object",msg}); + node.status({fill:"red",shape:"dot",text:"msg.params not an object"}); } } }