summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mannehed <samuel@cendio.se>2020-05-31 01:36:41 +0200
committerSamuel Mannehed <samuel@cendio.se>2020-05-31 23:37:29 +0200
commitcfb824ed03942b328d75ea1443f07edaa3579f68 (patch)
treec91c1398ea40c315a243491d39a2d54162368137
parent756af5b44c74a6a4b29d1a5846b2b0771e0daa29 (diff)
downloadnovnc-cfb824ed03942b328d75ea1443f07edaa3579f68.tar.gz
Add camelCase rule to eslint
-rw-r--r--.eslintrc1
-rw-r--r--core/deflator.js6
-rw-r--r--core/inflator.js4
-rw-r--r--tests/test.deflator.js2
-rw-r--r--tests/test.rfb.js2
5 files changed, 15 insertions, 0 deletions
diff --git a/.eslintrc b/.eslintrc
index 900a718..4b50d2f 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -44,5 +44,6 @@
"named": "never",
"asyncArrow": "always" }],
"switch-colon-spacing": ["error"],
+ "camelcase": ["error", { allow: ["^XK_", "^XF86XK_"] }],
}
}
diff --git a/core/deflator.js b/core/deflator.js
index ad3d0fb..fe2a8f7 100644
--- a/core/deflator.js
+++ b/core/deflator.js
@@ -21,12 +21,14 @@ export default class Deflator {
}
deflate(inData) {
+ /* eslint-disable camelcase */
this.strm.input = inData;
this.strm.avail_in = this.strm.input.length;
this.strm.next_in = 0;
this.strm.output = this.outputBuffer;
this.strm.avail_out = this.chunkSize;
this.strm.next_out = 0;
+ /* eslint-enable camelcase */
let lastRet = deflate(this.strm, Z_FULL_FLUSH);
let outData = new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);
@@ -41,9 +43,11 @@ export default class Deflator {
let chunks = [outData];
let totalLen = outData.length;
do {
+ /* eslint-disable camelcase */
this.strm.output = new Uint8Array(this.chunkSize);
this.strm.next_out = 0;
this.strm.avail_out = this.chunkSize;
+ /* eslint-enable camelcase */
lastRet = deflate(this.strm, Z_FULL_FLUSH);
@@ -69,9 +73,11 @@ export default class Deflator {
outData = newData;
}
+ /* eslint-disable camelcase */
this.strm.input = null;
this.strm.avail_in = 0;
this.strm.next_in = 0;
+ /* eslint-enable camelcase */
return outData;
}
diff --git a/core/inflator.js b/core/inflator.js
index e61a5bd..4b33760 100644
--- a/core/inflator.js
+++ b/core/inflator.js
@@ -22,6 +22,7 @@ export default class Inflate {
setInput(data) {
if (!data) {
//FIXME: flush remaining data.
+ /* eslint-disable camelcase */
this.strm.input = null;
this.strm.avail_in = 0;
this.strm.next_in = 0;
@@ -29,6 +30,7 @@ export default class Inflate {
this.strm.input = data;
this.strm.avail_in = this.strm.input.length;
this.strm.next_in = 0;
+ /* eslint-enable camelcase */
}
}
@@ -41,8 +43,10 @@ export default class Inflate {
this.strm.output = new Uint8Array(this.chunkSize);
}
+ /* eslint-disable camelcase */
this.strm.next_out = 0;
this.strm.avail_out = expected;
+ /* eslint-enable camelcase */
let ret = inflate(this.strm, 0); // Flush argument not used.
if (ret < 0) {
diff --git a/tests/test.deflator.js b/tests/test.deflator.js
index 2f2fab3..12e8a46 100644
--- a/tests/test.deflator.js
+++ b/tests/test.deflator.js
@@ -17,12 +17,14 @@ function _inflator(compText, expected) {
strm.output = new Uint8Array(chunkSize);
}
+ /* eslint-disable camelcase */
strm.input = compText;
strm.avail_in = strm.input.length;
strm.next_in = 0;
strm.next_out = 0;
strm.avail_out = expected.length;
+ /* eslint-enable camelcase */
let ret = inflate(strm, 0);
diff --git a/tests/test.rfb.js b/tests/test.rfb.js
index d195905..0481df1 100644
--- a/tests/test.rfb.js
+++ b/tests/test.rfb.js
@@ -70,11 +70,13 @@ function deflateWithSize(data) {
strm.output = new Uint8Array(chunkSize);
deflateInit(strm, 5);
+ /* eslint-disable camelcase */
strm.input = unCompData;
strm.avail_in = strm.input.length;
strm.next_in = 0;
strm.next_out = 0;
strm.avail_out = chunkSize;
+ /* eslint-enable camelcase */
deflate(strm, 3);