mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
eslint: change keyword-spacing from warning to error and fix violations.
This commit is contained in:
@@ -164,7 +164,15 @@
|
|||||||
"quote-props": 0,
|
"quote-props": 0,
|
||||||
"radix": 2,
|
"radix": 2,
|
||||||
"semi": 2,
|
"semi": 2,
|
||||||
"keyword-spacing": 1,
|
"keyword-spacing": ["error", {
|
||||||
|
"before": true,
|
||||||
|
"after": true,
|
||||||
|
"overrides": {
|
||||||
|
"return": { "after": true },
|
||||||
|
"throw": { "after": true },
|
||||||
|
"case": { "after": true }
|
||||||
|
}
|
||||||
|
}],
|
||||||
"space-before-blocks": 1,
|
"space-before-blocks": 1,
|
||||||
"strict": 1,
|
"strict": 1,
|
||||||
"unnecessary-strict": 0,
|
"unnecessary-strict": 0,
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ var page_params = {
|
|||||||
set_global('page_params', page_params);
|
set_global('page_params', page_params);
|
||||||
|
|
||||||
var patched_underscore = _.clone(_);
|
var patched_underscore = _.clone(_);
|
||||||
patched_underscore.debounce = function (f) { return(f); };
|
patched_underscore.debounce = function (f) { return f; };
|
||||||
global.patch_builtin('_', patched_underscore);
|
global.patch_builtin('_', patched_underscore);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -188,19 +188,19 @@ var _ = global._;
|
|||||||
'some_email@**everyone**.com'
|
'some_email@**everyone**.com'
|
||||||
];
|
];
|
||||||
var i;
|
var i;
|
||||||
for(i=0; i<messages_with_all_mentions.length; i++) {
|
for (i=0; i<messages_with_all_mentions.length; i++) {
|
||||||
assert(util.is_all_or_everyone_mentioned(messages_with_all_mentions[i]));
|
assert(util.is_all_or_everyone_mentioned(messages_with_all_mentions[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i=0; i<messages_with_everyone_mentions.length; i++) {
|
for (i=0; i<messages_with_everyone_mentions.length; i++) {
|
||||||
assert(util.is_all_or_everyone_mentioned(messages_with_everyone_mentions[i]));
|
assert(util.is_all_or_everyone_mentioned(messages_with_everyone_mentions[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i=0; i<messages_without_all_mentions.length; i++) {
|
for (i=0; i<messages_without_all_mentions.length; i++) {
|
||||||
assert(!util.is_all_or_everyone_mentioned(messages_without_everyone_mentions[i]));
|
assert(!util.is_all_or_everyone_mentioned(messages_without_everyone_mentions[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i=0; i<messages_without_everyone_mentions.length; i++) {
|
for (i=0; i<messages_without_everyone_mentions.length; i++) {
|
||||||
assert(!util.is_all_or_everyone_mentioned(messages_without_everyone_mentions[i]));
|
assert(!util.is_all_or_everyone_mentioned(messages_without_everyone_mentions[i]));
|
||||||
}
|
}
|
||||||
}());
|
}());
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ function mkdir_p(path) {
|
|||||||
// This works like mkdir -p in Unix.
|
// This works like mkdir -p in Unix.
|
||||||
try {
|
try {
|
||||||
fs.mkdirSync(path);
|
fs.mkdirSync(path);
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
if ( e.code !== 'EEXIST' ) {
|
if ( e.code !== 'EEXIST' ) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -802,7 +802,7 @@ function validate_stream_message() {
|
|||||||
var response;
|
var response;
|
||||||
|
|
||||||
if (!stream_data.is_subscribed(stream_name)) {
|
if (!stream_data.is_subscribed(stream_name)) {
|
||||||
switch(check_stream_for_send(stream_name, page_params.narrow_stream !== undefined)) {
|
switch (check_stream_for_send(stream_name, page_params.narrow_stream !== undefined)) {
|
||||||
case "does-not-exist":
|
case "does-not-exist":
|
||||||
response = "<p>The stream <b>" +
|
response = "<p>The stream <b>" +
|
||||||
Handlebars.Utils.escapeExpression(stream_name) + "</b> does not exist.</p>" +
|
Handlebars.Utils.escapeExpression(stream_name) + "</b> does not exist.</p>" +
|
||||||
@@ -1088,7 +1088,7 @@ $(function () {
|
|||||||
$("#send-status").addClass("alert-error")
|
$("#send-status").addClass("alert-error")
|
||||||
.removeClass("alert-info");
|
.removeClass("alert-info");
|
||||||
$("#compose-send-button").removeAttr("disabled");
|
$("#compose-send-button").removeAttr("disabled");
|
||||||
switch(err) {
|
switch (err) {
|
||||||
case 'BrowserNotSupported':
|
case 'BrowserNotSupported':
|
||||||
msg = "File upload is not yet available for your browser.";
|
msg = "File upload is not yet available for your browser.";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ exports.MessageList.prototype = {
|
|||||||
do {
|
do {
|
||||||
potential_closest_matches.push(closest);
|
potential_closest_matches.push(closest);
|
||||||
closest--;
|
closest--;
|
||||||
} while(closest > 0 && this._is_localonly_id(items[closest - 1].id));
|
} while (closest > 0 && this._is_localonly_id(items[closest - 1].id));
|
||||||
}
|
}
|
||||||
potential_closest_matches.push(closest);
|
potential_closest_matches.push(closest);
|
||||||
|
|
||||||
@@ -550,7 +550,7 @@ exports.MessageList.prototype = {
|
|||||||
var cur_idx = start_index;
|
var cur_idx = start_index;
|
||||||
do {
|
do {
|
||||||
cur_idx = op(cur_idx);
|
cur_idx = op(cur_idx);
|
||||||
} while(item_list[cur_idx] !== undefined && this._is_localonly_id(item_list[cur_idx].id));
|
} while (item_list[cur_idx] !== undefined && this._is_localonly_id(item_list[cur_idx].id));
|
||||||
return item_list[cur_idx];
|
return item_list[cur_idx];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ function dispatch_normal_event(event) {
|
|||||||
|
|
||||||
case 'update_message_flags':
|
case 'update_message_flags':
|
||||||
var new_value = event.operation === "add";
|
var new_value = event.operation === "add";
|
||||||
switch(event.flag) {
|
switch (event.flag) {
|
||||||
case 'starred':
|
case 'starred':
|
||||||
_.each(event.messages, function (message_id) {
|
_.each(event.messages, function (message_id) {
|
||||||
ui.update_starred(message_id, new_value);
|
ui.update_starred(message_id, new_value);
|
||||||
|
|||||||
@@ -558,7 +558,7 @@ exports.update_subscription_properties = function (stream_name, property, value)
|
|||||||
value: value});
|
value: value});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch(property) {
|
switch (property) {
|
||||||
case 'color':
|
case 'color':
|
||||||
stream_color.update_stream_color(sub, stream_name, value, {update_historical: true});
|
stream_color.update_stream_color(sub, stream_name, value, {update_historical: true});
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user