From 3b2e3fc08c8155256f817396a24ce99ca6b97591 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 18 Mar 2017 21:40:39 +0200 Subject: [PATCH] Enforce more space and new line rules --- .eslintrc.yml | 3 +++ client/js/libs/handlebars/parse.js | 1 - client/js/lounge.js | 3 --- src/clientManager.js | 1 - test/client/js/libs/handlebars/localetimeTest.js | 2 -- test/models/network.js | 1 - 6 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.eslintrc.yml b/.eslintrc.yml index d6b6a59e..353706cc 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -27,6 +27,7 @@ rules: no-else-return: 2 no-implicit-globals: 2 no-multi-spaces: 2 + no-multiple-empty-lines: [2, { "max": 1 }] no-shadow: 2 no-template-curly-in-string: 2 no-trailing-spaces: 2 @@ -34,11 +35,13 @@ rules: no-useless-escape: 2 no-useless-return: 2 object-curly-spacing: [2, never] + padded-blocks: [2, never] quote-props: [2, as-needed] quotes: [2, double, avoid-escape] semi: [2, always] space-before-blocks: 2 space-before-function-paren: [2, never] + space-in-parens: [2, never] space-infix-ops: 2 spaced-comment: [2, always] strict: 2 diff --git a/client/js/libs/handlebars/parse.js b/client/js/libs/handlebars/parse.js index cd61ff7e..325b049f 100644 --- a/client/js/libs/handlebars/parse.js +++ b/client/js/libs/handlebars/parse.js @@ -49,7 +49,6 @@ var styleCheck_Re = /[\x00-\x1F]/, // breaks all open styles ^O (\x0F) styleBreak = "\x0F"; - function styleTemplate(settings) { return "" + settings.text + ""; } diff --git a/client/js/lounge.js b/client/js/lounge.js index 81275fbd..a51b3fec 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -364,7 +364,6 @@ $(function() { lastDate = msgDate; }); } - } function renderChannelUsers(data) { @@ -498,7 +497,6 @@ $(function() { lastDate = msgDate; }); - }); socket.on("network", function(data) { @@ -1168,7 +1166,6 @@ $(function() { } catch (exception) { // `new Notification(...)` is not supported and should be silenced. } - } } } diff --git a/src/clientManager.js b/src/clientManager.js index 578972c3..a0f94f0f 100644 --- a/src/clientManager.js +++ b/src/clientManager.js @@ -96,7 +96,6 @@ ClientManager.prototype.addUser = function(name, password, enableLog) { return false; } try { - if (require("path").basename(name) !== name) { throw new Error(name + " is an invalid username."); } diff --git a/test/client/js/libs/handlebars/localetimeTest.js b/test/client/js/libs/handlebars/localetimeTest.js index 75debd8e..bccf3649 100644 --- a/test/client/js/libs/handlebars/localetimeTest.js +++ b/test/client/js/libs/handlebars/localetimeTest.js @@ -4,7 +4,6 @@ const expect = require("chai").expect; const localetime = require("../../../../../client/js/libs/handlebars/localetime"); describe("localetime Handlebars helper", () => { - it("should render a human-readable date", () => { // 12PM in UTC time const date = new Date("2014-05-22T12:00:00"); @@ -17,5 +16,4 @@ describe("localetime Handlebars helper", () => { expect(localetime(time)).to.equal("5/22/2014, 12:00:00 PM"); }); - }); diff --git a/test/models/network.js b/test/models/network.js index fe56157d..438c6251 100644 --- a/test/models/network.js +++ b/test/models/network.js @@ -8,7 +8,6 @@ var Network = require("../../src/models/network"); describe("Network", function() { describe("#export()", function() { - it("should produce an valid object", function() { var network = new Network({ name: "networkName",