mirror of
https://github.com/MichMich/MagicMirror.git
synced 2026-07-23 15:54:34 -07:00
refactor: use const instead of let for variable declarations (#4196)
This replaces `let` with `const` for variable declarations where it was possible. Using `const` [is considered best practice](https://www.xjavascript.com/blog/in-javascript-why-should-i-usually-prefer-const-to-let/#5-best-practices-const-first-let-second). I have enabled the corresponding ESLint rule and let the ESLint auto-fix the "wrong" usages of `let`.
This commit is contained in:
committed by
GitHub
parent
3e223b7fad
commit
cdab7a7ea3
@@ -29,17 +29,17 @@ Module.register("testNotification", {
|
||||
}
|
||||
},
|
||||
maketd (row, info) {
|
||||
let td = document.createElement("td");
|
||||
const td = document.createElement("td");
|
||||
row.appendChild(td);
|
||||
if (info !== null) {
|
||||
let colinfo = info.toString().split(":");
|
||||
const colinfo = info.toString().split(":");
|
||||
if (colinfo.length === 2) td.className = colinfo[1];
|
||||
td.innerText = colinfo[0];
|
||||
}
|
||||
return td;
|
||||
},
|
||||
addTableRow (table, col1 = null, col2 = null, col3 = null) {
|
||||
let tableRow = document.createElement("tr");
|
||||
const tableRow = document.createElement("tr");
|
||||
table.appendChild(tableRow);
|
||||
|
||||
this.maketd(tableRow, col1);
|
||||
@@ -49,7 +49,7 @@ Module.register("testNotification", {
|
||||
return tableRow;
|
||||
},
|
||||
getDom () {
|
||||
let wrapper = document.createElement("div");
|
||||
const wrapper = document.createElement("div");
|
||||
if (this.table) {
|
||||
wrapper.appendChild(this.table);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user