From caa46042bf2ee5d5b8c8b6b1bafb3b34cfa93d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Sun, 9 Oct 2016 15:14:02 -0400 Subject: [PATCH 1/2] Enforce strict mode across all JS files with ESLint Several ES6 additions are only available in strict mode. Example: > SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode Strict mode was also enabled in a few of our files already, and it is a good thing to have anyway. --- .eslintrc.yml | 1 + client/js/libs/handlebars/diff.js | 2 ++ client/js/libs/handlebars/equal.js | 2 ++ client/js/libs/handlebars/modes.js | 2 ++ client/js/libs/handlebars/parse.js | 2 ++ client/js/libs/handlebars/roundBadgeNumber.js | 2 ++ client/js/libs/handlebars/tz.js | 2 ++ client/js/libs/handlebars/users.js | 2 ++ client/js/loading-slow-alert.js | 2 ++ client/js/lounge.js | 2 ++ defaults/config.js | 2 ++ index.js | 3 +++ src/client.js | 2 ++ src/clientManager.js | 2 ++ src/command-line/add.js | 2 ++ src/command-line/config.js | 2 ++ src/command-line/edit.js | 2 ++ src/command-line/index.js | 2 ++ src/command-line/list.js | 2 ++ src/command-line/remove.js | 2 ++ src/command-line/reset.js | 2 ++ src/command-line/start.js | 2 ++ src/helper.js | 2 ++ src/identd.js | 2 ++ src/log.js | 2 ++ src/models/chan.js | 2 ++ src/models/msg.js | 2 ++ src/models/network.js | 2 ++ src/models/user.js | 2 ++ src/oidentd.js | 2 ++ src/plugins/inputs/action.js | 2 ++ src/plugins/inputs/connect.js | 2 ++ src/plugins/inputs/ctcp.js | 2 ++ src/plugins/inputs/disconnect.js | 2 ++ src/plugins/inputs/invite.js | 2 ++ src/plugins/inputs/kick.js | 2 ++ src/plugins/inputs/list.js | 2 ++ src/plugins/inputs/mode.js | 2 ++ src/plugins/inputs/msg.js | 2 ++ src/plugins/inputs/nick.js | 2 ++ src/plugins/inputs/notice.js | 2 ++ src/plugins/inputs/part.js | 2 ++ src/plugins/inputs/query.js | 2 ++ src/plugins/inputs/quit.js | 2 ++ src/plugins/inputs/raw.js | 2 ++ src/plugins/inputs/topic.js | 2 ++ src/plugins/irc-events/connection.js | 2 ++ src/plugins/irc-events/ctcp.js | 2 ++ src/plugins/irc-events/error.js | 2 ++ src/plugins/irc-events/invite.js | 2 ++ src/plugins/irc-events/join.js | 2 ++ src/plugins/irc-events/kick.js | 2 ++ src/plugins/irc-events/link.js | 2 ++ src/plugins/irc-events/list.js | 2 ++ src/plugins/irc-events/message.js | 2 ++ src/plugins/irc-events/mode.js | 2 ++ src/plugins/irc-events/motd.js | 2 ++ src/plugins/irc-events/names.js | 2 ++ src/plugins/irc-events/nick.js | 2 ++ src/plugins/irc-events/part.js | 2 ++ src/plugins/irc-events/quit.js | 2 ++ src/plugins/irc-events/topic.js | 2 ++ src/plugins/irc-events/unhandled.js | 2 ++ src/plugins/irc-events/welcome.js | 2 ++ src/plugins/irc-events/whois.js | 2 ++ src/userLog.js | 2 ++ test/fixtures/.lounge/config.js | 2 ++ test/fixtures/env.js | 2 ++ test/plugins/link.js | 2 ++ test/util.js | 2 ++ 70 files changed, 140 insertions(+) diff --git a/.eslintrc.yml b/.eslintrc.yml index 223901ec..354baa99 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -34,6 +34,7 @@ rules: space-before-blocks: 2 space-infix-ops: 2 spaced-comment: [2, always] + strict: 2 globals: log: false diff --git a/client/js/libs/handlebars/diff.js b/client/js/libs/handlebars/diff.js index 21ee523c..8cc0d135 100644 --- a/client/js/libs/handlebars/diff.js +++ b/client/js/libs/handlebars/diff.js @@ -1,3 +1,5 @@ +"use strict"; + var diff; Handlebars.registerHelper( diff --git a/client/js/libs/handlebars/equal.js b/client/js/libs/handlebars/equal.js index 15fdc033..426f54bd 100644 --- a/client/js/libs/handlebars/equal.js +++ b/client/js/libs/handlebars/equal.js @@ -1,3 +1,5 @@ +"use strict"; + Handlebars.registerHelper( "equal", function(a, b, opt) { a = a.toString(); diff --git a/client/js/libs/handlebars/modes.js b/client/js/libs/handlebars/modes.js index f2907846..bf97b033 100644 --- a/client/js/libs/handlebars/modes.js +++ b/client/js/libs/handlebars/modes.js @@ -1,3 +1,5 @@ +"use strict"; + Handlebars.registerHelper( "modes", function(mode) { var modes = { diff --git a/client/js/libs/handlebars/parse.js b/client/js/libs/handlebars/parse.js index 637fb0e7..b09086a6 100644 --- a/client/js/libs/handlebars/parse.js +++ b/client/js/libs/handlebars/parse.js @@ -1,3 +1,5 @@ +"use strict"; + Handlebars.registerHelper( "parse", function(text) { text = Handlebars.Utils.escapeExpression(text); diff --git a/client/js/libs/handlebars/roundBadgeNumber.js b/client/js/libs/handlebars/roundBadgeNumber.js index 1a6ad031..5982acdd 100644 --- a/client/js/libs/handlebars/roundBadgeNumber.js +++ b/client/js/libs/handlebars/roundBadgeNumber.js @@ -1,3 +1,5 @@ +"use strict"; + Handlebars.registerHelper( "roundBadgeNumber", function(count) { if (count < 1000) { diff --git a/client/js/libs/handlebars/tz.js b/client/js/libs/handlebars/tz.js index e38fff94..9b46be61 100644 --- a/client/js/libs/handlebars/tz.js +++ b/client/js/libs/handlebars/tz.js @@ -1,3 +1,5 @@ +"use strict"; + Handlebars.registerHelper( "tz", function(time) { time = new Date(time); diff --git a/client/js/libs/handlebars/users.js b/client/js/libs/handlebars/users.js index 1aa6ac08..977fbf90 100644 --- a/client/js/libs/handlebars/users.js +++ b/client/js/libs/handlebars/users.js @@ -1,3 +1,5 @@ +"use strict"; + Handlebars.registerHelper( "users", function(count) { return count + " " + (count === 1 ? "user" : "users"); diff --git a/client/js/loading-slow-alert.js b/client/js/loading-slow-alert.js index b86b6409..dcca1847 100644 --- a/client/js/loading-slow-alert.js +++ b/client/js/loading-slow-alert.js @@ -1,3 +1,5 @@ +"use strict"; + /* * This is a separate file for two reasons: * 1. CSP policy does not allow inline javascript diff --git a/client/js/lounge.js b/client/js/lounge.js index f6c8c56d..9b0cbaf1 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -1,3 +1,5 @@ +"use strict"; + $(function() { $("#loading-page-message").text("Connecting…"); diff --git a/defaults/config.js b/defaults/config.js index 09cd40b6..f84196e9 100644 --- a/defaults/config.js +++ b/defaults/config.js @@ -1,3 +1,5 @@ +"use strict"; + module.exports = { // // Set the server mode. diff --git a/index.js b/index.js index f78f00e4..f9ed254a 100755 --- a/index.js +++ b/index.js @@ -1,4 +1,7 @@ #!/usr/bin/env node + +"use strict"; + process.chdir(__dirname); // Perform node version check before loading any other files or modules diff --git a/src/client.js b/src/client.js index f8be844a..94730e53 100644 --- a/src/client.js +++ b/src/client.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var package = require("../package.json"); var Chan = require("./models/chan"); diff --git a/src/clientManager.js b/src/clientManager.js index 4024fbea..1ec9f6ee 100644 --- a/src/clientManager.js +++ b/src/clientManager.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var fs = require("fs"); var Client = require("./client"); diff --git a/src/command-line/add.js b/src/command-line/add.js index fc5f8265..2e3723e0 100644 --- a/src/command-line/add.js +++ b/src/command-line/add.js @@ -1,3 +1,5 @@ +"use strict"; + var ClientManager = new require("../clientManager"); var bcrypt = require("bcrypt-nodejs"); var program = require("commander"); diff --git a/src/command-line/config.js b/src/command-line/config.js index 9488d507..d5ad2e1b 100644 --- a/src/command-line/config.js +++ b/src/command-line/config.js @@ -1,3 +1,5 @@ +"use strict"; + var program = require("commander"); var child = require("child_process"); var Helper = require("../helper"); diff --git a/src/command-line/edit.js b/src/command-line/edit.js index 7b2ca558..dadd0e52 100644 --- a/src/command-line/edit.js +++ b/src/command-line/edit.js @@ -1,3 +1,5 @@ +"use strict"; + var ClientManager = new require("../clientManager"); var program = require("commander"); var child = require("child_process"); diff --git a/src/command-line/index.js b/src/command-line/index.js index dfc41cd1..5b6ea728 100644 --- a/src/command-line/index.js +++ b/src/command-line/index.js @@ -1,3 +1,5 @@ +"use strict"; + global.log = require("../log.js"); var program = require("commander"); diff --git a/src/command-line/list.js b/src/command-line/list.js index 4e8f8bc3..d8c07189 100644 --- a/src/command-line/list.js +++ b/src/command-line/list.js @@ -1,3 +1,5 @@ +"use strict"; + var ClientManager = new require("../clientManager"); var program = require("commander"); diff --git a/src/command-line/remove.js b/src/command-line/remove.js index 0d3b2ce9..efd9092d 100644 --- a/src/command-line/remove.js +++ b/src/command-line/remove.js @@ -1,3 +1,5 @@ +"use strict"; + var ClientManager = new require("../clientManager"); var program = require("commander"); diff --git a/src/command-line/reset.js b/src/command-line/reset.js index 3c046629..e5cf6609 100644 --- a/src/command-line/reset.js +++ b/src/command-line/reset.js @@ -1,3 +1,5 @@ +"use strict"; + var bcrypt = require("bcrypt-nodejs"); var ClientManager = new require("../clientManager"); var fs = require("fs"); diff --git a/src/command-line/start.js b/src/command-line/start.js index 4386a2fb..a277e319 100644 --- a/src/command-line/start.js +++ b/src/command-line/start.js @@ -1,3 +1,5 @@ +"use strict"; + var ClientManager = new require("../clientManager"); var program = require("commander"); var server = require("../server"); diff --git a/src/helper.js b/src/helper.js index c2a69c83..21e99fcb 100644 --- a/src/helper.js +++ b/src/helper.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var path = require("path"); var os = require("os"); diff --git a/src/identd.js b/src/identd.js index f598052a..e8928074 100644 --- a/src/identd.js +++ b/src/identd.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var net = require("net"); diff --git a/src/log.js b/src/log.js index 153f3a3d..483d5345 100644 --- a/src/log.js +++ b/src/log.js @@ -1,3 +1,5 @@ +"use strict"; + var colors = require("colors/safe"); var moment = require("moment"); var Helper = require("./helper"); diff --git a/src/models/chan.js b/src/models/chan.js index 750e798a..0eddf4a1 100644 --- a/src/models/chan.js +++ b/src/models/chan.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var Helper = require("../helper"); diff --git a/src/models/msg.js b/src/models/msg.js index 73c19ff1..e59d4dd3 100644 --- a/src/models/msg.js +++ b/src/models/msg.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); Msg.Type = { diff --git a/src/models/network.js b/src/models/network.js index cbeea7d4..3f5a3472 100644 --- a/src/models/network.js +++ b/src/models/network.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var Chan = require("./chan"); diff --git a/src/models/user.js b/src/models/user.js index e5898253..c3a3be1a 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); module.exports = User; diff --git a/src/oidentd.js b/src/oidentd.js index aa3819ad..9412d6cd 100644 --- a/src/oidentd.js +++ b/src/oidentd.js @@ -1,3 +1,5 @@ +"use strict"; + var fs = require("fs"); var Helper = require("./helper"); diff --git a/src/plugins/inputs/action.js b/src/plugins/inputs/action.js index 4f8a4000..4b625854 100644 --- a/src/plugins/inputs/action.js +++ b/src/plugins/inputs/action.js @@ -1,3 +1,5 @@ +"use strict"; + exports.commands = ["slap", "me"]; exports.input = function(network, chan, cmd, args) { diff --git a/src/plugins/inputs/connect.js b/src/plugins/inputs/connect.js index 04296247..885b6112 100644 --- a/src/plugins/inputs/connect.js +++ b/src/plugins/inputs/connect.js @@ -1,3 +1,5 @@ +"use strict"; + var Msg = require("../../models/msg"); exports.commands = ["connect", "server"]; diff --git a/src/plugins/inputs/ctcp.js b/src/plugins/inputs/ctcp.js index 75906b79..0acc6aec 100644 --- a/src/plugins/inputs/ctcp.js +++ b/src/plugins/inputs/ctcp.js @@ -1,3 +1,5 @@ +"use strict"; + exports.commands = ["ctcp"]; exports.input = function(network, chan, cmd, args) { diff --git a/src/plugins/inputs/disconnect.js b/src/plugins/inputs/disconnect.js index a0ad99fb..bd43e40d 100644 --- a/src/plugins/inputs/disconnect.js +++ b/src/plugins/inputs/disconnect.js @@ -1,3 +1,5 @@ +"use strict"; + exports.commands = ["disconnect"]; exports.input = function(network, chan, cmd, args) { diff --git a/src/plugins/inputs/invite.js b/src/plugins/inputs/invite.js index d4543ee3..f7ac7a07 100644 --- a/src/plugins/inputs/invite.js +++ b/src/plugins/inputs/invite.js @@ -1,3 +1,5 @@ +"use strict"; + var Chan = require("../../models/chan"); exports.commands = ["invite"]; diff --git a/src/plugins/inputs/kick.js b/src/plugins/inputs/kick.js index d0b74802..2ce955a1 100644 --- a/src/plugins/inputs/kick.js +++ b/src/plugins/inputs/kick.js @@ -1,3 +1,5 @@ +"use strict"; + exports.commands = ["kick"]; exports.input = function(network, chan, cmd, args) { diff --git a/src/plugins/inputs/list.js b/src/plugins/inputs/list.js index 70a4a65f..79512a48 100644 --- a/src/plugins/inputs/list.js +++ b/src/plugins/inputs/list.js @@ -1,3 +1,5 @@ +"use strict"; + exports.commands = ["list"]; exports.input = function(network, chan, cmd, args) { diff --git a/src/plugins/inputs/mode.js b/src/plugins/inputs/mode.js index b476256d..cc26b80b 100644 --- a/src/plugins/inputs/mode.js +++ b/src/plugins/inputs/mode.js @@ -1,3 +1,5 @@ +"use strict"; + exports.commands = ["mode", "op", "voice", "deop", "devoice"]; exports.input = function(network, chan, cmd, args) { diff --git a/src/plugins/inputs/msg.js b/src/plugins/inputs/msg.js index 379dea61..45dee5f8 100644 --- a/src/plugins/inputs/msg.js +++ b/src/plugins/inputs/msg.js @@ -1,3 +1,5 @@ +"use strict"; + exports.commands = ["msg", "say"]; exports.input = function(network, chan, cmd, args) { diff --git a/src/plugins/inputs/nick.js b/src/plugins/inputs/nick.js index a267b1e4..b53126de 100644 --- a/src/plugins/inputs/nick.js +++ b/src/plugins/inputs/nick.js @@ -1,3 +1,5 @@ +"use strict"; + var Msg = require("../../models/msg"); exports.commands = ["nick"]; diff --git a/src/plugins/inputs/notice.js b/src/plugins/inputs/notice.js index aa20f237..a2c160eb 100644 --- a/src/plugins/inputs/notice.js +++ b/src/plugins/inputs/notice.js @@ -1,3 +1,5 @@ +"use strict"; + exports.commands = ["notice"]; exports.input = function(network, chan, cmd, args) { diff --git a/src/plugins/inputs/part.js b/src/plugins/inputs/part.js index 5a480b3f..6a837271 100644 --- a/src/plugins/inputs/part.js +++ b/src/plugins/inputs/part.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var Msg = require("../../models/msg"); var Chan = require("../../models/chan"); diff --git a/src/plugins/inputs/query.js b/src/plugins/inputs/query.js index 1aa7f840..2cf23e8a 100644 --- a/src/plugins/inputs/query.js +++ b/src/plugins/inputs/query.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var Chan = require("../../models/chan"); var Msg = require("../../models/msg"); diff --git a/src/plugins/inputs/quit.js b/src/plugins/inputs/quit.js index 9039c704..be41378a 100644 --- a/src/plugins/inputs/quit.js +++ b/src/plugins/inputs/quit.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); exports.commands = ["quit"]; diff --git a/src/plugins/inputs/raw.js b/src/plugins/inputs/raw.js index b58a993c..b18fbc4d 100644 --- a/src/plugins/inputs/raw.js +++ b/src/plugins/inputs/raw.js @@ -1,3 +1,5 @@ +"use strict"; + exports.commands = ["raw", "send", "quote"]; exports.input = function(network, chan, cmd, args) { diff --git a/src/plugins/inputs/topic.js b/src/plugins/inputs/topic.js index d9e66852..1d403eb3 100644 --- a/src/plugins/inputs/topic.js +++ b/src/plugins/inputs/topic.js @@ -1,3 +1,5 @@ +"use strict"; + exports.commands = ["topic"]; exports.input = function(network, chan, cmd, args) { diff --git a/src/plugins/irc-events/connection.js b/src/plugins/irc-events/connection.js index fe356102..306872e6 100644 --- a/src/plugins/irc-events/connection.js +++ b/src/plugins/irc-events/connection.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var identd = require("../../identd"); var Msg = require("../../models/msg"); diff --git a/src/plugins/irc-events/ctcp.js b/src/plugins/irc-events/ctcp.js index f853d60b..a4ed7033 100644 --- a/src/plugins/irc-events/ctcp.js +++ b/src/plugins/irc-events/ctcp.js @@ -1,3 +1,5 @@ +"use strict"; + var Msg = require("../../models/msg"); module.exports = function(irc, network) { diff --git a/src/plugins/irc-events/error.js b/src/plugins/irc-events/error.js index 3a92ebb7..477645fb 100644 --- a/src/plugins/irc-events/error.js +++ b/src/plugins/irc-events/error.js @@ -1,3 +1,5 @@ +"use strict"; + var Msg = require("../../models/msg"); module.exports = function(irc, network) { diff --git a/src/plugins/irc-events/invite.js b/src/plugins/irc-events/invite.js index 2d5a6181..13e22c8a 100644 --- a/src/plugins/irc-events/invite.js +++ b/src/plugins/irc-events/invite.js @@ -1,3 +1,5 @@ +"use strict"; + var Msg = require("../../models/msg"); module.exports = function(irc, network) { diff --git a/src/plugins/irc-events/join.js b/src/plugins/irc-events/join.js index 69198904..c7f91ec9 100644 --- a/src/plugins/irc-events/join.js +++ b/src/plugins/irc-events/join.js @@ -1,3 +1,5 @@ +"use strict"; + var Chan = require("../../models/chan"); var Msg = require("../../models/msg"); var User = require("../../models/user"); diff --git a/src/plugins/irc-events/kick.js b/src/plugins/irc-events/kick.js index 16b182ec..a02c0363 100644 --- a/src/plugins/irc-events/kick.js +++ b/src/plugins/irc-events/kick.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var Msg = require("../../models/msg"); diff --git a/src/plugins/irc-events/link.js b/src/plugins/irc-events/link.js index a9e2399f..0aff8bc4 100644 --- a/src/plugins/irc-events/link.js +++ b/src/plugins/irc-events/link.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var cheerio = require("cheerio"); var Msg = require("../../models/msg"); diff --git a/src/plugins/irc-events/list.js b/src/plugins/irc-events/list.js index db6fdd3c..0dbf2881 100644 --- a/src/plugins/irc-events/list.js +++ b/src/plugins/irc-events/list.js @@ -1,3 +1,5 @@ +"use strict"; + var Chan = require("../../models/chan"); var Msg = require("../../models/msg"); diff --git a/src/plugins/irc-events/message.js b/src/plugins/irc-events/message.js index cbe36fae..0f345cd7 100644 --- a/src/plugins/irc-events/message.js +++ b/src/plugins/irc-events/message.js @@ -1,3 +1,5 @@ +"use strict"; + var Chan = require("../../models/chan"); var Msg = require("../../models/msg"); diff --git a/src/plugins/irc-events/mode.js b/src/plugins/irc-events/mode.js index 886c42fb..6cadabee 100644 --- a/src/plugins/irc-events/mode.js +++ b/src/plugins/irc-events/mode.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var Chan = require("../../models/chan"); var Msg = require("../../models/msg"); diff --git a/src/plugins/irc-events/motd.js b/src/plugins/irc-events/motd.js index 0b1f7afd..1075d229 100644 --- a/src/plugins/irc-events/motd.js +++ b/src/plugins/irc-events/motd.js @@ -1,3 +1,5 @@ +"use strict"; + var Msg = require("../../models/msg"); module.exports = function(irc, network) { diff --git a/src/plugins/irc-events/names.js b/src/plugins/irc-events/names.js index 6bee2696..3c16149c 100644 --- a/src/plugins/irc-events/names.js +++ b/src/plugins/irc-events/names.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var User = require("../../models/user"); diff --git a/src/plugins/irc-events/nick.js b/src/plugins/irc-events/nick.js index c84b1b27..8b3e9b20 100644 --- a/src/plugins/irc-events/nick.js +++ b/src/plugins/irc-events/nick.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var Msg = require("../../models/msg"); diff --git a/src/plugins/irc-events/part.js b/src/plugins/irc-events/part.js index 706de66f..6711aced 100644 --- a/src/plugins/irc-events/part.js +++ b/src/plugins/irc-events/part.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var Msg = require("../../models/msg"); diff --git a/src/plugins/irc-events/quit.js b/src/plugins/irc-events/quit.js index f3e473f6..24104852 100644 --- a/src/plugins/irc-events/quit.js +++ b/src/plugins/irc-events/quit.js @@ -1,3 +1,5 @@ +"use strict"; + var _ = require("lodash"); var Msg = require("../../models/msg"); diff --git a/src/plugins/irc-events/topic.js b/src/plugins/irc-events/topic.js index 286325f7..0ee6ba6e 100644 --- a/src/plugins/irc-events/topic.js +++ b/src/plugins/irc-events/topic.js @@ -1,3 +1,5 @@ +"use strict"; + var Msg = require("../../models/msg"); module.exports = function(irc, network) { diff --git a/src/plugins/irc-events/unhandled.js b/src/plugins/irc-events/unhandled.js index c089d0cf..46b98f22 100644 --- a/src/plugins/irc-events/unhandled.js +++ b/src/plugins/irc-events/unhandled.js @@ -1,3 +1,5 @@ +"use strict"; + var Msg = require("../../models/msg"); module.exports = function(irc, network) { diff --git a/src/plugins/irc-events/welcome.js b/src/plugins/irc-events/welcome.js index 5d86e686..311d5667 100644 --- a/src/plugins/irc-events/welcome.js +++ b/src/plugins/irc-events/welcome.js @@ -1,3 +1,5 @@ +"use strict"; + var Msg = require("../../models/msg"); module.exports = function(irc, network) { diff --git a/src/plugins/irc-events/whois.js b/src/plugins/irc-events/whois.js index 6b531a35..86cdcaa9 100644 --- a/src/plugins/irc-events/whois.js +++ b/src/plugins/irc-events/whois.js @@ -1,3 +1,5 @@ +"use strict"; + var Chan = require("../../models/chan"); var Msg = require("../../models/msg"); diff --git a/src/userLog.js b/src/userLog.js index 1e10f4d4..e35df410 100644 --- a/src/userLog.js +++ b/src/userLog.js @@ -1,3 +1,5 @@ +"use strict"; + var fs = require("fs"); var fsextra = require("fs-extra"); var moment = require("moment"); diff --git a/test/fixtures/.lounge/config.js b/test/fixtures/.lounge/config.js index 3f900589..7e5efe76 100644 --- a/test/fixtures/.lounge/config.js +++ b/test/fixtures/.lounge/config.js @@ -1,3 +1,5 @@ +"use strict"; + var config = require("../../../defaults/config.js"); config.prefetch = true; diff --git a/test/fixtures/env.js b/test/fixtures/env.js index 08aafaf0..f3c51b0d 100644 --- a/test/fixtures/env.js +++ b/test/fixtures/env.js @@ -1,2 +1,4 @@ +"use strict"; + var home = require("path").join(__dirname, ".lounge"); require("../../src/helper").setHome(home); diff --git a/test/plugins/link.js b/test/plugins/link.js index 278a2713..5267dd58 100644 --- a/test/plugins/link.js +++ b/test/plugins/link.js @@ -1,3 +1,5 @@ +"use strict"; + var assert = require("assert"); var util = require("../util"); diff --git a/test/util.js b/test/util.js index 58edddd7..0b14f3f1 100644 --- a/test/util.js +++ b/test/util.js @@ -1,3 +1,5 @@ +"use strict"; + var EventEmitter = require("events").EventEmitter; var util = require("util"); var _ = require("lodash"); From e416d74f571634252f7c4d8a3c6bdde0fcab79a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Sun, 9 Oct 2016 15:15:20 -0400 Subject: [PATCH 2/2] Rename package variable, reserved in strict mode This has been renamed similarly in other files of the projects already. --- src/client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client.js b/src/client.js index 94730e53..6dc06c04 100644 --- a/src/client.js +++ b/src/client.js @@ -1,7 +1,7 @@ "use strict"; var _ = require("lodash"); -var package = require("../package.json"); +var pkg = require("../package.json"); var Chan = require("./models/chan"); var crypto = require("crypto"); var userLog = require("./userLog"); @@ -230,7 +230,7 @@ Client.prototype.connect = function(args) { } else { webirc = { password: config.webirc[network.host], - username: package.name, + username: pkg.name, address: args.ip, hostname: args.hostname }; @@ -257,7 +257,7 @@ Client.prototype.connect = function(args) { }); network.irc.connect({ - version: package.name + " " + package.version + " -- " + package.homepage, + version: pkg.name + " " + pkg.version + " -- " + pkg.homepage, host: network.host, port: network.port, nick: nick,