diff --git a/.eslintrc b/.eslintrc index a3990b66..e553807b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -29,5 +29,6 @@ "ArrayExpression": "first", "ObjectExpression": "first", "ignoreComments": true }], + "comma-spacing": ["error"], } } diff --git a/app/ui.js b/app/ui.js index dba90aee..1fb7034d 100644 --- a/app/ui.js +++ b/app/ui.js @@ -145,9 +145,9 @@ const UI = { // set manually let port = window.location.port; if (!port) { - if (window.location.protocol.substring(0,5) == 'https') { + 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; } } @@ -936,7 +936,7 @@ const UI = { }, clipboardReceive(e) { - Log.Debug(">> UI.clipboardReceive: " + e.detail.text.substr(0,40) + "..."); + Log.Debug(">> UI.clipboardReceive: " + e.detail.text.substr(0, 40) + "..."); document.getElementById('noVNC_clipboard_text').value = e.detail.text; Log.Debug("<< UI.clipboardReceive"); }, @@ -948,7 +948,7 @@ const UI = { clipboardSend() { const text = document.getElementById('noVNC_clipboard_text').value; - Log.Debug(">> UI.clipboardSend: " + text.substr(0,40) + "..."); + Log.Debug(">> UI.clipboardSend: " + text.substr(0, 40) + "..."); UI.rfb.clipboardPasteFrom(text); Log.Debug("<< UI.clipboardSend"); }, @@ -1551,7 +1551,7 @@ const UI = { UI.rfb.touchButton = num; } - const blist = [0, 1,2,4]; + const blist = [0, 1, 2, 4]; for (let b = 0; b < blist.length; b++) { const button = document.getElementById('noVNC_mouse_button' + blist[b]); diff --git a/core/base64.js b/core/base64.js index 895aa464..7871c538 100644 --- a/core/base64.js +++ b/core/base64.js @@ -43,6 +43,7 @@ export default { }, /* Convert Base64 data to a string */ + /* eslint-disable comma-spacing */ toBinaryTable : [ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, @@ -53,6 +54,7 @@ export default { -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1 ], + /* eslint-enable comma-spacing */ decode(data, offset) { offset = typeof(offset) !== 'undefined' ? offset : 0; diff --git a/core/des.js b/core/des.js index 5adc7ae9..175066bc 100644 --- a/core/des.js +++ b/core/des.js @@ -75,6 +75,8 @@ * fine Java utilities: http://www.acme.com/java/ */ +/* eslint-disable comma-spacing */ + export default function DES(passwd) { "use strict"; diff --git a/core/display.js b/core/display.js index d6db075c..8c0a0c12 100644 --- a/core/display.js +++ b/core/display.js @@ -457,7 +457,7 @@ export default class Display { } } - blitRgbImage(x, y , width, height, arr, offset, from_queue) { + blitRgbImage(x, y, width, height, arr, offset, from_queue) { if (this._renderQ.length !== 0 && !from_queue) { // NB(directxman12): it's technically more performant here to use preallocated arrays, // but it's a lot of extra work for not a lot of payoff -- if we're using the render queue, diff --git a/tests/test.rfb.js b/tests/test.rfb.js index 5bdb6abc..dfbbdf7d 100644 --- a/tests/test.rfb.js +++ b/tests/test.rfb.js @@ -1876,7 +1876,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should fail on an invalid subencoding', function () { - sinon.spy(client,"_fail"); + sinon.spy(client, "_fail"); const info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }]; const rects = [[45]]; // an invalid subencoding send_fbu_msg(info, rects, client); diff --git a/tests/test.websock.js b/tests/test.websock.js index 8d2b157d..79b03f8e 100644 --- a/tests/test.websock.js +++ b/tests/test.websock.js @@ -264,7 +264,7 @@ describe('Websock', function() { }); describe('opening', function () { - it('should pick the correct protocols if none are given' , function () { + it('should pick the correct protocols if none are given', function () { });