From 39550a56d5519fea1e39ae5d8f8810af388df787 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Fri, 19 Apr 2024 13:17:36 +0100 Subject: [PATCH] language: Move es-x/no-resizable-and-growable-arraybuffers to rules-es5 Fixes: #555 --- client/common.json | 3 +-- language/rules-es5.json | 3 ++- test/fixtures/client/common/valid.js | 5 ++--- test/fixtures/client/es6/valid.js | 5 +++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/client/common.json b/client/common.json index 3d8f734e..b676095a 100644 --- a/client/common.json +++ b/client/common.json @@ -11,7 +11,6 @@ "no-console": "error", "no-implied-eval": "error", "unicorn/no-invalid-remove-event-listener": "error", - "security/detect-possible-timing-attacks": "off", - "es-x/no-resizable-and-growable-arraybuffers": "off" + "security/detect-possible-timing-attacks": "off" } } diff --git a/language/rules-es5.json b/language/rules-es5.json index 656fdb04..0f94acd2 100644 --- a/language/rules-es5.json +++ b/language/rules-es5.json @@ -1,5 +1,6 @@ { "rules": { - "es-x/no-symbol-prototype-description": "off" + "es-x/no-symbol-prototype-description": "off", + "es-x/no-resizable-and-growable-arraybuffers": "off" } } diff --git a/test/fixtures/client/common/valid.js b/test/fixtures/client/common/valid.js index 76988b96..b37c723c 100644 --- a/test/fixtures/client/common/valid.js +++ b/test/fixtures/client/common/valid.js @@ -1,6 +1,5 @@ ( function () { - // Off: es-x/no-resizable-and-growable-arraybuffers (#555) - function resize( input, cachedValue ) { + function checkHash( input, cachedValue ) { var hash = JSON.stringify( input ); // Off: security/detect-possible-timing-attacks (#503) if ( hash === cachedValue ) { @@ -8,5 +7,5 @@ } } - resize(); + checkHash(); }() ); diff --git a/test/fixtures/client/es6/valid.js b/test/fixtures/client/es6/valid.js index c4264ac2..b811073b 100644 --- a/test/fixtures/client/es6/valid.js +++ b/test/fixtures/client/es6/valid.js @@ -77,6 +77,11 @@ // Valid: es-x/no-string-raw String.raw(); + // ArrayBuffer.prototype.resize is disabled, but conflicts + // with many plain object properties. + // Off: es-x/no-resizable-and-growable-arraybuffers (#555) + node.resize(); + // Symbol.prototype.descrition is disabled, but conflicts // with many plain object properties. // Off: es-x/no-symbol-prototype-description