Merge pull request #291 from thelounge/xpaw/strict-curly

Stricter eslint rule for curly brackets
This commit is contained in:
Jérémie Astori 2016-05-01 14:03:43 -04:00
commit 228a2d33ee
6 changed files with 25 additions and 13 deletions

View File

@ -9,8 +9,9 @@ env:
rules: rules:
block-spacing: [2, always] block-spacing: [2, always]
brace-style: [2, 1tbs]
comma-dangle: 0 comma-dangle: 0
curly: [2, multi-line] curly: [2, all]
eqeqeq: 2 eqeqeq: 2
indent: [2, tab] indent: [2, tab]
keyword-spacing: [2, {before: true, after: true}] keyword-spacing: [2, {before: true, after: true}]

View File

@ -46,7 +46,9 @@ $(function() {
}; };
} }
$("#play").on("click", function() { pop.play(); }); $("#play").on("click", function() {
pop.play();
});
$(".tse-scrollable").TrackpadScrollEmulator(); $(".tse-scrollable").TrackpadScrollEmulator();
@ -193,7 +195,9 @@ $(function() {
); );
renderChannel(data.chan); renderChannel(data.chan);
var chan = sidebar.find(".chan") var chan = sidebar.find(".chan")
.sort(function(a, b) { return $(a).data("id") - $(b).data("id"); }) .sort(function(a, b) {
return $(a).data("id") - $(b).data("id");
})
.last(); .last();
if (!whois) { if (!whois) {
chan = chan.filter(":not(.query)"); chan = chan.filter(":not(.query)");
@ -422,8 +426,7 @@ $(function() {
socket.emit("names", { socket.emit("names", {
target: data.chan target: data.chan
}); });
} } else {
else {
chan.data("needsNamesRefresh", true); chan.data("needsNamesRefresh", true);
} }
}); });
@ -552,8 +555,7 @@ $(function() {
text: target.text(), text: target.text(),
data: target.data("name") data: target.data("name")
}); });
} } else if (target.hasClass("chan")) {
else if (target.hasClass("chan")) {
output = render("contextmenu_item", { output = render("contextmenu_item", {
class: "chan", class: "chan",
text: target.data("title"), text: target.data("title"),

View File

@ -36,7 +36,9 @@ program
prompt: "[thelounge] Enter password: ", prompt: "[thelounge] Enter password: ",
silent: true silent: true
}, function(err, password) { }, function(err, password) {
if (!err) add(manager, name, password); if (!err) {
add(manager, name, password);
}
}); });
}); });

View File

@ -79,8 +79,7 @@ function parse(msg, url, res, client) {
case "image/jpeg": case "image/jpeg":
if (res.size < (config.prefetchMaxImageSize * 1024)) { if (res.size < (config.prefetchMaxImageSize * 1024)) {
toggle.type = "image"; toggle.type = "image";
} } else {
else {
return; return;
} }
break; break;
@ -122,7 +121,10 @@ function fetch(url, cb) {
next(null, data); next(null, data);
})) }))
.pipe(es.wait(function(err, data) { .pipe(es.wait(function(err, data) {
if (err) return; if (err) {
return;
}
var body; var body;
var type; var type;
var size = req.response.headers["content-length"]; var size = req.response.headers["content-length"];

View File

@ -74,7 +74,10 @@ module.exports = function(options) {
}; };
function index(req, res, next) { function index(req, res, next) {
if (req.url.split("?")[0] !== "/") return next(); if (req.url.split("?")[0] !== "/") {
return next();
}
return fs.readFile("client/index.html", "utf-8", function(err, file) { return fs.readFile("client/index.html", "utf-8", function(err, file) {
var data = _.merge( var data = _.merge(
package, package,

View File

@ -11,7 +11,9 @@ function makeUser(name) {
} }
function getUserNames(chan) { function getUserNames(chan) {
return chan.users.map(function(u) { return u.name; }); return chan.users.map(function(u) {
return u.name;
});
} }
describe("Chan", function() { describe("Chan", function() {