diff --git a/.eslintrc b/.eslintrc index c28a798c..ecf55847 100644 --- a/.eslintrc +++ b/.eslintrc @@ -31,6 +31,7 @@ "ignoreComments": true }], "comma-spacing": ["error"], "comma-style": ["error"], + "curly": ["error", "multi-line"], "func-call-spacing": ["error"], "func-names": ["error"], "func-style": ["error", "declaration", { "allowArrowFunctions": true }], diff --git a/app/localization.js b/app/localization.js index 8f424b34..90a98d48 100644 --- a/app/localization.js +++ b/app/localization.js @@ -53,10 +53,12 @@ export class Localizer { .replace("_", "-") .split("-"); - if (userLang[0] !== supLang[0]) + if (userLang[0] !== supLang[0]) { continue; - if (userLang[1] !== supLang[1]) + } + if (userLang[1] !== supLang[1]) { continue; + } this.language = supportedLanguages[j]; return; @@ -69,10 +71,12 @@ export class Localizer { .replace("_", "-") .split("-"); - if (userLang[0] !== supLang[0]) + if (userLang[0] !== supLang[0]) { continue; - if (supLang[1] !== undefined) + } + if (supLang[1] !== undefined) { continue; + } this.language = supportedLanguages[j]; return; diff --git a/core/input/keyboard.js b/core/input/keyboard.js index f8a65824..55ce9171 100644 --- a/core/input/keyboard.js +++ b/core/input/keyboard.js @@ -249,10 +249,11 @@ export default class Keyboard { // Character (A-Z) let char = String.fromCharCode(e.keyCode); // A feeble attempt at the correct case - if (e.shiftKey) + if (e.shiftKey) { char = char.toUpperCase(); - else + } else { char = char.toLowerCase(); + } keysym = char.charCodeAt(); } else { // Unknown, give up diff --git a/core/rfb.js b/core/rfb.js index 5049c335..c5793893 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -2348,8 +2348,10 @@ RFB.encodingHandlers = { else if (ctl === 0x0A) cmode = "png"; else if (ctl & 0x04) cmode = "filter"; else if (ctl < 0x04) cmode = "copy"; - else return this._fail("Illegal tight compression received (ctl: " + + else { + return this._fail("Illegal tight compression received (ctl: " + ctl + ")"); + } if (isTightPNG && (ctl < 0x08)) { return this._fail("BasicCompression received in TightPNG rect"); diff --git a/core/util/cursor.js b/core/util/cursor.js index 18aa7beb..d36b657f 100644 --- a/core/util/cursor.js +++ b/core/util/cursor.js @@ -187,13 +187,15 @@ export default class Cursor { } _showCursor() { - if (this._canvas.style.visibility === 'hidden') + if (this._canvas.style.visibility === 'hidden') { this._canvas.style.visibility = ''; + } } _hideCursor() { - if (this._canvas.style.visibility !== 'hidden') + if (this._canvas.style.visibility !== 'hidden') { this._canvas.style.visibility = 'hidden'; + } } // Should we currently display the cursor? @@ -201,24 +203,28 @@ export default class Cursor { // different cursor set) _shouldShowCursor(target) { // Easy case - if (target === this._target) + if (target === this._target) { return true; + } // Other part of the DOM? - if (!this._target.contains(target)) + if (!this._target.contains(target)) { return false; + } // Has the child its own cursor? // FIXME: How can we tell that a sub element has an // explicit "cursor: none;"? - if (window.getComputedStyle(target).cursor !== 'none') + if (window.getComputedStyle(target).cursor !== 'none') { return false; + } return true; } _updateVisibility(target) { - if (this._shouldShowCursor(target)) + if (this._shouldShowCursor(target)) { this._showCursor(); - else + } else { this._hideCursor(); + } } _updatePosition() { diff --git a/tests/karma-test-main.js b/tests/karma-test-main.js index c1b3ad4b..28436667 100644 --- a/tests/karma-test-main.js +++ b/tests/karma-test-main.js @@ -35,8 +35,9 @@ document.body.appendChild(script); function fallback() { if (!window._noVNC_has_module_support) { /* eslint-disable no-console */ - if (console) + if (console) { console.log("No module support detected. Loading fallback..."); + } /* eslint-enable no-console */ let loader = document.createElement("script"); loader.src = "base/vendor/browser-es-module-loader/dist/browser-es-module-loader.js"; diff --git a/tests/playback-ui.js b/tests/playback-ui.js index 295f983c..012eebcf 100644 --- a/tests/playback-ui.js +++ b/tests/playback-ui.js @@ -49,8 +49,9 @@ function enableUI() { frames = VNC_frame_data; // Only present in older recordings - if (window.VNC_frame_encoding) + if (window.VNC_frame_encoding) { encoding = VNC_frame_encoding; + } } class IterationPlayer {