From ba2df1f95bacda1fb531bc4c0fe016ad5a8cfe35 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Mon, 25 Sep 2017 15:32:31 -0700 Subject: [PATCH] jshint: Turn on ES6 mode, fix a few issues in new logging file FREEBIE --- .jshintrc | 1 + js/logging.js | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.jshintrc b/.jshintrc index c3f4213ab..2ac841797 100644 --- a/.jshintrc +++ b/.jshintrc @@ -29,6 +29,7 @@ "debug" : false, "eqnull" : false, "es5" : false, + "esversion" : 6, "esnext" : false, "moz" : false, "evil" : false, diff --git a/js/logging.js b/js/logging.js index b9520d6a4..64c39343c 100644 --- a/js/logging.js +++ b/js/logging.js @@ -1,5 +1,3 @@ -'use strict'; - const electron = require('electron'); const bunyan = require('bunyan'); const _ = require('lodash'); @@ -35,13 +33,13 @@ function log() { console._log.apply(console, consoleArgs); const str = args.join(' ').replace(PHONE_REGEX, "+[REDACTED]$1"); - ipc.send('log-info', str) + ipc.send('log-info', str); } if (window.console) { console._log = console.log; console.log = log; -}; +} // The mechanics of preparing a log for publish @@ -69,7 +67,7 @@ function format(entries) { function fetch() { return getHeader() + '\n' + format(ipc.sendSync('fetch-log')); -}; +} function publish(log) { log = log || fetch(); @@ -90,7 +88,7 @@ function publish(log) { }) .fail(resolve); }); -}; +} // A modern logging interface for the browser @@ -129,7 +127,7 @@ window.log = { trace: _.partial(logAtLevel, 'trace'), fetch, publish, -} +}; window.onerror = function(message, script, line, col, error) { log.error(error.stack);