summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2018-09-06 15:39:26 +0200
committerPierre Ossman <ossman@cendio.se>2018-09-06 15:39:26 +0200
commita98881151f2aef7a9213d95eb9ed41d7918777ca (patch)
treed6483959d99ce06f574a631de4cb38058d776196
parente15950a8efeca1b15adff3290135f10228961a1e (diff)
downloadnovnc-a98881151f2aef7a9213d95eb9ed41d7918777ca.tar.gz
Enforce brace style
-rw-r--r--.eslintrc6
-rw-r--r--app/ui.js3
-rw-r--r--core/input/domkeytable.js9
3 files changed, 10 insertions, 8 deletions
diff --git a/.eslintrc b/.eslintrc
index b85e51c..f1e3073 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -8,6 +8,8 @@
},
"extends": "eslint:recommended",
"rules": {
+ // Unsafe or confusing stuff that we forbid
+
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }],
"no-constant-condition": ["error", { "checkLoops": false }],
"no-var": "error",
@@ -18,5 +20,9 @@
"arrow-parens": ["error", "as-needed", { "requireForBlockBody": true }],
"arrow-spacing": ["error"],
"no-confusing-arrow": ["error", { "allowParens": true }],
+
+ // Enforced coding style
+
+ "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
}
}
diff --git a/app/ui.js b/app/ui.js
index c03f8d3..dba90ae 100644
--- a/app/ui.js
+++ b/app/ui.js
@@ -147,8 +147,7 @@ const UI = {
if (!port) {
if (window.location.protocol.substring(0,5) == 'https') {
port = 443;
- }
- else if (window.location.protocol.substring(0,4) == 'http') {
+ } else if (window.location.protocol.substring(0,4) == 'http') {
port = 80;
}
}
diff --git a/core/input/domkeytable.js b/core/input/domkeytable.js
index 6028801..fdac483 100644
--- a/core/input/domkeytable.js
+++ b/core/input/domkeytable.js
@@ -15,23 +15,20 @@ import KeyTable from "./keysym.js";
const DOMKeyTable = {};
-function addStandard(key, standard)
-{
+function addStandard(key, standard) {
if (standard === undefined) throw "Undefined keysym for key \"" + key + "\"";
if (key in DOMKeyTable) throw "Duplicate entry for key \"" + key + "\"";
DOMKeyTable[key] = [standard, standard, standard, standard];
}
-function addLeftRight(key, left, right)
-{
+function addLeftRight(key, left, right) {
if (left === undefined) throw "Undefined keysym for key \"" + key + "\"";
if (right === undefined) throw "Undefined keysym for key \"" + key + "\"";
if (key in DOMKeyTable) throw "Duplicate entry for key \"" + key + "\"";
DOMKeyTable[key] = [left, left, right, left];
}
-function addNumpad(key, standard, numpad)
-{
+function addNumpad(key, standard, numpad) {
if (standard === undefined) throw "Undefined keysym for key \"" + key + "\"";
if (numpad === undefined) throw "Undefined keysym for key \"" + key + "\"";
if (key in DOMKeyTable) throw "Duplicate entry for key \"" + key + "\"";