Tighten xo rules

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
XhmikosR
2025-02-22 18:25:56 +02:00
parent b647049dc0
commit f8a0a1d4ec
28 changed files with 1152 additions and 1130 deletions

View File

@@ -6,9 +6,9 @@
* Please see LICENSE file for your rights under this license. */
function eventsource() {
var alInfo = $("#alInfo");
var alSuccess = $("#alSuccess");
var ta = $("#output");
const alInfo = $("#alInfo");
const alSuccess = $("#alSuccess");
const ta = $("#output");
ta.html("");
ta.show();
@@ -37,10 +37,10 @@ function eventsource() {
// Enqueue the next data chunk into our target stream
controller.enqueue(value);
var string = new TextDecoder().decode(value);
const string = new TextDecoder().decode(value);
parseLines(ta, string);
if (string.indexOf("Done.") !== -1) {
if (string.includes("Done.")) {
alSuccess.show();
}
@@ -53,13 +53,13 @@ function eventsource() {
.catch(error => console.error(error)); // eslint-disable-line no-console
}
$("#gravityBtn").on("click", function () {
$("#gravityBtn").on("click", () => {
$("#gravityBtn").prop("disabled", true);
eventsource();
});
// Handle hiding of alerts
$(function () {
$(() => {
$("[data-hide]").on("click", function () {
$(this)
.closest("." + $(this).attr("data-hide"))
@@ -68,8 +68,8 @@ $(function () {
// Do we want to start updating immediately?
// gravity?go
var searchString = globalThis.location.search.substring(1);
if (searchString.indexOf("go") !== -1) {
const searchString = globalThis.location.search.substring(1);
if (searchString.includes("go")) {
$("#gravityBtn").prop("disabled", true);
eventsource();
}
@@ -80,7 +80,7 @@ function parseLines(ta, str) {
// We want to split the text before an "OVER" escape sequence to allow overwriting previous line when needed
// Splitting the text on "\r"
var lines = str.split(/(?=\r)/g);
const lines = str.split(/(?=\r)/g);
for (let i = 0; i < lines.length; i++) {
if (lines[i][0] === "\r") {