Merge pull request #684 from thelounge/astorije/strict-mode

Strict mode for all JS files
This commit is contained in:
Jérémie Astori 2016-10-09 17:55:19 -04:00 committed by GitHub
commit 6b597d3b2f
70 changed files with 143 additions and 3 deletions

View File

@ -34,6 +34,7 @@ rules:
space-before-blocks: 2
space-infix-ops: 2
spaced-comment: [2, always]
strict: 2
globals:
log: false

View File

@ -1,3 +1,5 @@
"use strict";
var diff;
Handlebars.registerHelper(

View File

@ -1,3 +1,5 @@
"use strict";
Handlebars.registerHelper(
"equal", function(a, b, opt) {
a = a.toString();

View File

@ -1,3 +1,5 @@
"use strict";
Handlebars.registerHelper(
"modes", function(mode) {
var modes = {

View File

@ -1,3 +1,5 @@
"use strict";
Handlebars.registerHelper(
"parse", function(text) {
text = Handlebars.Utils.escapeExpression(text);

View File

@ -1,3 +1,5 @@
"use strict";
Handlebars.registerHelper(
"roundBadgeNumber", function(count) {
if (count < 1000) {

View File

@ -1,3 +1,5 @@
"use strict";
Handlebars.registerHelper(
"tz", function(time) {
time = new Date(time);

View File

@ -1,3 +1,5 @@
"use strict";
Handlebars.registerHelper(
"users", function(count) {
return count + " " + (count === 1 ? "user" : "users");

View File

@ -1,3 +1,5 @@
"use strict";
/*
* This is a separate file for two reasons:
* 1. CSP policy does not allow inline javascript

View File

@ -1,3 +1,5 @@
"use strict";
$(function() {
$("#loading-page-message").text("Connecting…");

View File

@ -1,3 +1,5 @@
"use strict";
module.exports = {
//
// Set the server mode.

View File

@ -1,4 +1,7 @@
#!/usr/bin/env node
"use strict";
process.chdir(__dirname);
// Perform node version check before loading any other files or modules

View File

@ -1,5 +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");
@ -228,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
};
@ -255,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,

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var fs = require("fs");
var Client = require("./client");

View File

@ -1,3 +1,5 @@
"use strict";
var ClientManager = new require("../clientManager");
var bcrypt = require("bcrypt-nodejs");
var program = require("commander");

View File

@ -1,3 +1,5 @@
"use strict";
var program = require("commander");
var child = require("child_process");
var Helper = require("../helper");

View File

@ -1,3 +1,5 @@
"use strict";
var ClientManager = new require("../clientManager");
var program = require("commander");
var child = require("child_process");

View File

@ -1,3 +1,5 @@
"use strict";
global.log = require("../log.js");
var program = require("commander");

View File

@ -1,3 +1,5 @@
"use strict";
var ClientManager = new require("../clientManager");
var program = require("commander");

View File

@ -1,3 +1,5 @@
"use strict";
var ClientManager = new require("../clientManager");
var program = require("commander");

View File

@ -1,3 +1,5 @@
"use strict";
var bcrypt = require("bcrypt-nodejs");
var ClientManager = new require("../clientManager");
var fs = require("fs");

View File

@ -1,3 +1,5 @@
"use strict";
var ClientManager = new require("../clientManager");
var program = require("commander");
var server = require("../server");

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var path = require("path");
var os = require("os");

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var net = require("net");

View File

@ -1,3 +1,5 @@
"use strict";
var colors = require("colors/safe");
var moment = require("moment");
var Helper = require("./helper");

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var Helper = require("../helper");

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
Msg.Type = {

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var Chan = require("./chan");

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
module.exports = User;

View File

@ -1,3 +1,5 @@
"use strict";
var fs = require("fs");
var Helper = require("./helper");

View File

@ -1,3 +1,5 @@
"use strict";
exports.commands = ["slap", "me"];
exports.input = function(network, chan, cmd, args) {

View File

@ -1,3 +1,5 @@
"use strict";
var Msg = require("../../models/msg");
exports.commands = ["connect", "server"];

View File

@ -1,3 +1,5 @@
"use strict";
exports.commands = ["ctcp"];
exports.input = function(network, chan, cmd, args) {

View File

@ -1,3 +1,5 @@
"use strict";
exports.commands = ["disconnect"];
exports.input = function(network, chan, cmd, args) {

View File

@ -1,3 +1,5 @@
"use strict";
var Chan = require("../../models/chan");
exports.commands = ["invite"];

View File

@ -1,3 +1,5 @@
"use strict";
exports.commands = ["kick"];
exports.input = function(network, chan, cmd, args) {

View File

@ -1,3 +1,5 @@
"use strict";
exports.commands = ["list"];
exports.input = function(network, chan, cmd, args) {

View File

@ -1,3 +1,5 @@
"use strict";
exports.commands = ["mode", "op", "voice", "deop", "devoice"];
exports.input = function(network, chan, cmd, args) {

View File

@ -1,3 +1,5 @@
"use strict";
exports.commands = ["msg", "say"];
exports.input = function(network, chan, cmd, args) {

View File

@ -1,3 +1,5 @@
"use strict";
var Msg = require("../../models/msg");
exports.commands = ["nick"];

View File

@ -1,3 +1,5 @@
"use strict";
exports.commands = ["notice"];
exports.input = function(network, chan, cmd, args) {

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var Msg = require("../../models/msg");
var Chan = require("../../models/chan");

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var Chan = require("../../models/chan");
var Msg = require("../../models/msg");

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
exports.commands = ["quit"];

View File

@ -1,3 +1,5 @@
"use strict";
exports.commands = ["raw", "send", "quote"];
exports.input = function(network, chan, cmd, args) {

View File

@ -1,3 +1,5 @@
"use strict";
exports.commands = ["topic"];
exports.input = function(network, chan, cmd, args) {

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var identd = require("../../identd");
var Msg = require("../../models/msg");

View File

@ -1,3 +1,5 @@
"use strict";
var Msg = require("../../models/msg");
module.exports = function(irc, network) {

View File

@ -1,3 +1,5 @@
"use strict";
var Msg = require("../../models/msg");
module.exports = function(irc, network) {

View File

@ -1,3 +1,5 @@
"use strict";
var Msg = require("../../models/msg");
module.exports = function(irc, network) {

View File

@ -1,3 +1,5 @@
"use strict";
var Chan = require("../../models/chan");
var Msg = require("../../models/msg");
var User = require("../../models/user");

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var Msg = require("../../models/msg");

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var cheerio = require("cheerio");
var Msg = require("../../models/msg");

View File

@ -1,3 +1,5 @@
"use strict";
var Chan = require("../../models/chan");
var Msg = require("../../models/msg");

View File

@ -1,3 +1,5 @@
"use strict";
var Chan = require("../../models/chan");
var Msg = require("../../models/msg");

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var Chan = require("../../models/chan");
var Msg = require("../../models/msg");

View File

@ -1,3 +1,5 @@
"use strict";
var Msg = require("../../models/msg");
module.exports = function(irc, network) {

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var User = require("../../models/user");

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var Msg = require("../../models/msg");

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var Msg = require("../../models/msg");

View File

@ -1,3 +1,5 @@
"use strict";
var _ = require("lodash");
var Msg = require("../../models/msg");

View File

@ -1,3 +1,5 @@
"use strict";
var Msg = require("../../models/msg");
module.exports = function(irc, network) {

View File

@ -1,3 +1,5 @@
"use strict";
var Msg = require("../../models/msg");
module.exports = function(irc, network) {

View File

@ -1,3 +1,5 @@
"use strict";
var Msg = require("../../models/msg");
module.exports = function(irc, network) {

View File

@ -1,3 +1,5 @@
"use strict";
var Chan = require("../../models/chan");
var Msg = require("../../models/msg");

View File

@ -1,3 +1,5 @@
"use strict";
var fs = require("fs");
var fsextra = require("fs-extra");
var moment = require("moment");

View File

@ -1,3 +1,5 @@
"use strict";
var config = require("../../../defaults/config.js");
config.prefetch = true;

View File

@ -1,2 +1,4 @@
"use strict";
var home = require("path").join(__dirname, ".lounge");
require("../../src/helper").setHome(home);

View File

@ -1,3 +1,5 @@
"use strict";
var assert = require("assert");
var util = require("../util");

View File

@ -1,3 +1,5 @@
"use strict";
var EventEmitter = require("events").EventEmitter;
var util = require("util");
var _ = require("lodash");