]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Drop Crockford's `switch` indentation
authorAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 15 Sep 2018 15:32:40 +0000 (18:32 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 15 Sep 2018 15:32:40 +0000 (18:32 +0300)
.eslintrc.json
interface/js/app/history.js
interface/js/app/rspamd.js

index b48d887dbe873fcb5b26fecc56dad4f00d48ec59..bf4c767c926f911ffd4235a80e13ddcf3c72f296 100644 (file)
@@ -17,6 +17,7 @@
         "func-names": "off",
         // "func-style": ["error", "declaration"],
         "id-length": ["error", { "min": 1 }],
+        "indent": ["error", 4, { "SwitchCase": 1 }],
         // "max-len": ["error", { "code": 120 }],
         "max-params": ["warn", 6],
         "max-statements": ["warn", 28],
         "callback-return": "off",
         "consistent-return": "off",
         "consistent-this": "off",
-        "default-case": "off",
         "func-style": "off",
         "function-paren-newline": "off",
-        "global-require": "off",
         "guard-for-in": "off",
         "key-spacing": "off",
         "line-comment-position": "off",
index 16d4b49d27d0f38317c96a0a9130f4cbe6f854c6..fa80a10cdc4f7057c2fb797cc7cb01580d2e07dc 100644 (file)
@@ -62,30 +62,30 @@ define(["jquery", "footable", "humanize"],
         function preprocess_item(item) {
             for (var prop in item) {
                 switch (prop) {
-                case "rcpt_mime":
-                case "rcpt_smtp":
-                    escape_HTML_array(item[prop]);
-                    break;
-                case "symbols":
-                    Object.keys(item.symbols).map(function (key) {
-                        var sym = item.symbols[key];
-                        if (!sym.name) {
-                            sym.name = key;
-                        }
-                        sym.name = escapeHTML(sym.name);
-                        if (sym.description) {
-                            sym.description = escapeHTML(sym.description);
-                        }
+                    case "rcpt_mime":
+                    case "rcpt_smtp":
+                        escape_HTML_array(item[prop]);
+                        break;
+                    case "symbols":
+                        Object.keys(item.symbols).map(function (key) {
+                            var sym = item.symbols[key];
+                            if (!sym.name) {
+                                sym.name = key;
+                            }
+                            sym.name = escapeHTML(sym.name);
+                            if (sym.description) {
+                                sym.description = escapeHTML(sym.description);
+                            }
 
-                        if (sym.options) {
-                            escape_HTML_array(sym.options);
+                            if (sym.options) {
+                                escape_HTML_array(sym.options);
+                            }
+                        });
+                        break;
+                    default:
+                        if (typeof (item[prop]) === "string") {
+                            item[prop] = escapeHTML(item[prop]);
                         }
-                    });
-                    break;
-                default:
-                    if (typeof (item[prop]) === "string") {
-                        item[prop] = escapeHTML(item[prop]);
-                    }
                 }
             }
 
index 1e41afaaf29b0b6e6ae0f01b9dc08a6be70b1536..e7b86a9c269d18a7eb9a75443eb1e01ef5ff87f4 100644 (file)
@@ -83,37 +83,38 @@ function ($, D3pie, visibility, NProgress, tab_stat, tab_graph, tab_config,
         }
 
         switch (tab_id) {
-        case "#status_nav":
-            tab_stat.statWidgets(ui, graphs, checked_server);
-            timer_id.status = Visibility.every(10000, function () {
+            case "#status_nav":
                 tab_stat.statWidgets(ui, graphs, checked_server);
-            });
-            break;
-        case "#throughput_nav":
-            tab_graph.draw(ui, graphs, tables, neighbours, checked_server, selData);
-
-            var autoRefresh = {
-                hourly: 60000,
-                daily: 300000
-            };
-            timer_id.throughput = Visibility.every(autoRefresh[selData] || 3600000, function () {
+                timer_id.status = Visibility.every(10000, function () {
+                    tab_stat.statWidgets(ui, graphs, checked_server);
+                });
+                break;
+            case "#throughput_nav":
                 tab_graph.draw(ui, graphs, tables, neighbours, checked_server, selData);
-            });
-            break;
-        case "#configuration_nav":
-            tab_config.getActions(ui, checked_server);
-            tab_config.getMaps(ui, checked_server);
-            break;
-        case "#symbols_nav":
-            tab_symbols.getSymbols(ui, tables, checked_server);
-            break;
-        case "#history_nav":
-            tab_history.getHistory(ui, tables);
-            tab_history.getErrors(ui, tables);
-            break;
-        case "#disconnect":
-            disconnect();
-            break;
+
+                var autoRefresh = {
+                    hourly: 60000,
+                    daily: 300000
+                };
+                timer_id.throughput = Visibility.every(autoRefresh[selData] || 3600000, function () {
+                    tab_graph.draw(ui, graphs, tables, neighbours, checked_server, selData);
+                });
+                break;
+            case "#configuration_nav":
+                tab_config.getActions(ui, checked_server);
+                tab_config.getMaps(ui, checked_server);
+                break;
+            case "#symbols_nav":
+                tab_symbols.getSymbols(ui, tables, checked_server);
+                break;
+            case "#history_nav":
+                tab_history.getHistory(ui, tables);
+                tab_history.getErrors(ui, tables);
+                break;
+            case "#disconnect":
+                disconnect();
+                break;
+            default:
         }
 
         setTimeout(function () {