From 128abf3090c762bf1ab19c8c81823c168c8ecd3e Mon Sep 17 00:00:00 2001
From: Alexander Rose <alexander.rose@weirdbyte.de>
Date: Sun, 12 Sep 2021 23:13:44 -0700
Subject: [PATCH] lint: add no-multi-spaces rule

---
 .eslintrc.json              | 3 ++-
 src/mol-util/zip/huffman.ts | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.eslintrc.json b/.eslintrc.json
index 61b024262..75507b37c 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -51,7 +51,8 @@
         }],
         "space-before-function-paren": "off",
         "func-call-spacing": "off",
-        "no-multi-spaces": "error"
+        "no-multi-spaces": "error",
+        "block-spacing": "error"
     },
     "overrides": [
         {
diff --git a/src/mol-util/zip/huffman.ts b/src/mol-util/zip/huffman.ts
index e3ce56cf8..16d5263b4 100644
--- a/src/mol-util/zip/huffman.ts
+++ b/src/mol-util/zip/huffman.ts
@@ -32,7 +32,7 @@ export function _hufTree(hst: NumberArray, tree: number[], MAXL: number) {
         tree[(l2 << 1) + 1] = 1;
         return 1;
     }
-    list.sort(function (a, b){return a.f - b.f;});
+    list.sort(function (a, b){ return a.f - b.f; });
     let a = list[0], b = list[1], i0 = 0, i1 = 1, i2 = 2;
     list[0] = {
         lit: -1,
@@ -80,7 +80,7 @@ function setDepth(t: HufTree, d: number): number {
 function restrictDepth(dps: HufTree[], MD: number, maxl: number) {
     let i = 0, dbt = 0;
     const bCost = 1 << (maxl - MD);
-    dps.sort(function (a: HufTree, b: HufTree){return b.d === a.d ? a.f - b.f : b.d - a.d;});
+    dps.sort(function (a: HufTree, b: HufTree){ return b.d === a.d ? a.f - b.f : b.d - a.d; });
 
     for(i = 0; i < dps.length; i++) {
         if(dps[i].d > MD) {
-- 
GitLab