eslint: enforce use of const when variable not modified

This commit is contained in:
JFH
2021-05-31 00:09:51 +02:00
parent a4ef206050
commit 074df9cdec
16 changed files with 27 additions and 21 deletions

View File

@@ -221,7 +221,7 @@ export default {
// setSelectMode();
});
let oldToolSourceCancel = $id('tool_source_cancel');
const oldToolSourceCancel = $id('tool_source_cancel');
const toolSourceCancel = oldToolSourceCancel.cloneNode(true);
toolSourceCancel.style.display = 'none';
toolSourceCancel.id = 'foreign_cancel';

View File

@@ -76,7 +76,7 @@ export default {
const y = opts.mouse_y / zoom;
// We do our own formatting
let text = svgEditor.i18next.t(`${name}:text`, { x, y });
const text = svgEditor.i18next.t(`${name}:text`, { x, y });
// Show the text using the custom alert function
alert(text);
}

View File

@@ -507,7 +507,7 @@ export default {
libOpts.style.display = 'none';
back.style.display = 'block';
});
let span = document.createElement("span");
const span = document.createElement("span");
span.textContent = description;
li.appendChild(span);
});

View File

@@ -4,7 +4,7 @@
// can't use npm version as the dragmove is different.
let _loaded = false;
let _callbacks = [];
const _callbacks = [];
const _isTouch = window.ontouchstart !== undefined;
export const dragmove = function(target, handler, parent, onStart, onEnd, onDrag) {

View File

@@ -104,7 +104,7 @@ export default {
const items = txt.split(';');
selElems.forEach((elem) => {
if (elem && elem.getAttribute('class').includes('placemark')) {
let elements = elem.children;
const elements = elem.children;
Array.prototype.forEach.call(elements, function(i, _){
const [ , , type, n ] = i.id.split('_');
if (type === 'txt') {
@@ -125,7 +125,7 @@ export default {
font = font.join(' ');
selElems.forEach((elem) => {
if (elem && elem.getAttribute('class').includes('placemark')) {
let elements = elem.children;
const elements = elem.children;
Array.prototype.forEach.call(elements, function(i, _){
const [ , , type ] = i.id.split('_');
if (type === 'txt') {

View File

@@ -23,7 +23,7 @@ export default {
const filename = getFileNameFromTitle();
// $.post(saveSvgAction, { output_svg: svg, filename });
let postData = { output_svg: svg, filename };
const postData = { output_svg: svg, filename };
fetch(saveSvgAction, {
method: "POST",
body: JSON.stringify(postData)