]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Add camelCase rule to eslint
authorSamuel Mannehed <samuel@cendio.se>
Sat, 30 May 2020 23:36:41 +0000 (01:36 +0200)
committerSamuel Mannehed <samuel@cendio.se>
Sun, 31 May 2020 21:37:29 +0000 (23:37 +0200)
.eslintrc
core/deflator.js
core/inflator.js
tests/test.deflator.js
tests/test.rfb.js

index 900a7186efc4f5d9b1ab728ecc1c825de20d2924..4b50d2ff095fa8a2008d6ec7a66813aac0f1b466 100644 (file)
--- a/.eslintrc
+++ b/.eslintrc
@@ -44,5 +44,6 @@
                                                    "named": "never",
                                                    "asyncArrow": "always" }],
         "switch-colon-spacing": ["error"],
+        "camelcase": ["error", { allow: ["^XK_", "^XF86XK_"] }],
     }
 }
index ad3d0fb77107dbd5d9d357241ca96e9a302be297..fe2a8f7036b350ddb8275c5294da36f70533d673 100644 (file)
@@ -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;
     }
index e61a5bd441095b973f039092275a4907cea879ac..4b337607b0399e664ffc650878f7f1f4c7649a93 100644 (file)
@@ -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) {
index 2f2fab3a2f169af89a3fac529092ee7030053032..12e8a46bfa58e1b071e90ade57e0f26b13ddd7c8 100644 (file)
@@ -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);
 
index d19590538aee1d2d056d91fc73fa7455035944d0..0481df15c3cfdc9be54e0043667e63a5bea36213 100644 (file)
@@ -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);