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:
block-spacing: [2, always]
brace-style: [2, 1tbs]
comma-dangle: 0
curly: [2, multi-line]
curly: [2, all]
eqeqeq: 2
indent: [2, tab]
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();
@ -193,7 +195,9 @@ $(function() {
);
renderChannel(data.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();
if (!whois) {
chan = chan.filter(":not(.query)");
@ -422,8 +426,7 @@ $(function() {
socket.emit("names", {
target: data.chan
});
}
else {
} else {
chan.data("needsNamesRefresh", true);
}
});
@ -552,8 +555,7 @@ $(function() {
text: target.text(),
data: target.data("name")
});
}
else if (target.hasClass("chan")) {
} else if (target.hasClass("chan")) {
output = render("contextmenu_item", {
class: "chan",
text: target.data("title"),

View file

@ -36,7 +36,9 @@ program
prompt: "[thelounge] Enter password: ",
silent: true
}, 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":
if (res.size < (config.prefetchMaxImageSize * 1024)) {
toggle.type = "image";
}
else {
} else {
return;
}
break;
@ -122,7 +121,10 @@ function fetch(url, cb) {
next(null, data);
}))
.pipe(es.wait(function(err, data) {
if (err) return;
if (err) {
return;
}
var body;
var type;
var size = req.response.headers["content-length"];

View file

@ -74,7 +74,10 @@ module.exports = function(options) {
};
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) {
var data = _.merge(
package,

View file

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