]> git.lizzy.rs Git - rust.git/commitdiff
Add new lint to enforce whitespace after keywords
authorGuillaume Gomez <guillaume.gomez@huawei.com>
Thu, 19 May 2022 15:19:08 +0000 (17:19 +0200)
committerGuillaume Gomez <guillaume.gomez@huawei.com>
Thu, 19 May 2022 15:19:22 +0000 (17:19 +0200)
src/librustdoc/html/static/.eslintrc.js
src/librustdoc/html/static/js/storage.js

index 7634a15b9bd19ed6993f84e0c985424747fd42fa..9d4c45b8a62511427a4d1fe63aeeb50ea481010d 100644 (file)
@@ -34,5 +34,9 @@ module.exports = {
             "1tbs",
             { "allowSingleLine": false }
         ],
+        "keyword-spacing": [
+            "error",
+            { "before": true, "after": true }
+        ],
     }
 };
index 948885cd30a598d601724e25be322525206654bf..3fcf66a817ee131315c9bec941c8f204e444cc10 100644 (file)
@@ -103,7 +103,7 @@ function onEachLazy(lazyArray, func, reversed) {
 function updateLocalStorage(name, value) {
     try {
         window.localStorage.setItem("rustdoc-" + name, value);
-    } catch(e) {
+    } catch (e) {
         // localStorage is not accessible, do nothing
     }
 }
@@ -111,7 +111,7 @@ function updateLocalStorage(name, value) {
 function getCurrentValue(name) {
     try {
         return window.localStorage.getItem("rustdoc-" + name);
-    } catch(e) {
+    } catch (e) {
         return null;
     }
 }