From db607768a71e27e04f8901a52df53df3eaa4c4d2 Mon Sep 17 00:00:00 2001 From: JFH Date: Sat, 25 Jul 2020 19:31:51 +0200 Subject: [PATCH] remove the warning for no-reference-in-iterator (at least temporarly) --- .eslintrc.js | 1 + src/common/utilities.js | 2 +- src/editor/extensions/ext-connector.js | 1 - src/editor/locale/locale.js | 1 - src/external/jamilih/jml-es.js | 6 ++---- src/svgcanvas/svgcanvas.js | 2 +- 6 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 44f15d2e..4b19b9bf 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -360,6 +360,7 @@ module.exports = { ignoreRegExpLiterals: true } */ 'unicorn/prefer-query-selector': 'off', + 'unicorn/no-fn-reference-in-iterator': 'off', 'unicorn/prefer-node-append': 'off', 'unicorn/no-zero-fractions': 'off', 'unicorn/prefer-number-properties': 'off', diff --git a/src/common/utilities.js b/src/common/utilities.js index e2a387f1..812ffbab 100644 --- a/src/common/utilities.js +++ b/src/common/utilities.js @@ -1220,7 +1220,7 @@ export const getElem = (supportsSelectors()) } : function (id) { // jQuery lookup: twice as slow as xpath in FF - return $(svgroot_).find('[id=' + id + ']')[0]; + return $(svgroot_).find(`[id=${id}]`)[0]; }; /** diff --git a/src/editor/extensions/ext-connector.js b/src/editor/extensions/ext-connector.js index 7cd1f70a..13629d48 100644 --- a/src/editor/extensions/ext-connector.js +++ b/src/editor/extensions/ext-connector.js @@ -1,4 +1,3 @@ -/* eslint-disable unicorn/no-fn-reference-in-iterator */ /** * @file ext-connector.js * diff --git a/src/editor/locale/locale.js b/src/editor/locale/locale.js index 9a5a1c8c..6eaef5a8 100644 --- a/src/editor/locale/locale.js +++ b/src/editor/locale/locale.js @@ -1,4 +1,3 @@ -/* eslint-disable unicorn/no-fn-reference-in-iterator */ /* globals jQuery */ /** * Localizing script for SVG-edit UI. diff --git a/src/external/jamilih/jml-es.js b/src/external/jamilih/jml-es.js index 484285ec..74a3292e 100644 --- a/src/external/jamilih/jml-es.js +++ b/src/external/jamilih/jml-es.js @@ -746,7 +746,7 @@ const jml = function jml(...args) { while (node.childNodes[j]) { const cn = node.childNodes[j]; cn.remove(); // `j` should stay the same as removing will cause node to be present - } // eslint-disable-next-line unicorn/no-fn-reference-in-iterator + } attVal.childNodes.forEach(_childrenToJML(node)); @@ -773,13 +773,11 @@ const jml = function jml(...args) { } if (attVal.head) { - // eslint-disable-next-line unicorn/no-fn-reference-in-iterator attVal.head.forEach(_appendJML(head)); } } if (attVal.body) { - // eslint-disable-next-line unicorn/no-fn-reference-in-iterator attVal.body.forEach(_appendJMLOrText(body)); } } @@ -1048,7 +1046,7 @@ const jml = function jml(...args) { // Todo: Fix to allow application of stylesheets of style tags within fragments? - return nodes.length <= 1 ? nodes[0] // eslint-disable-next-line unicorn/no-fn-reference-in-iterator + return nodes.length <= 1 ? nodes[0] // eslint-disable-next-line : nodes.reduce(_fragReducer, doc.createDocumentFragment()); // nodes; } diff --git a/src/svgcanvas/svgcanvas.js b/src/svgcanvas/svgcanvas.js index 6947d302..89038f33 100644 --- a/src/svgcanvas/svgcanvas.js +++ b/src/svgcanvas/svgcanvas.js @@ -1,4 +1,4 @@ -/* eslint-disable indent, unicorn/no-fn-reference-in-iterator */ +/* eslint-disable indent */ /* globals jQuery, jsPDF */ /** * Numerous tools for working with the editor's "canvas".