silence eslint undefined function errors

This commit is contained in:
Sj-Si 2024-03-26 14:11:01 -04:00
parent a3228a55a2
commit 5c0f315a22
2 changed files with 25 additions and 10 deletions

View File

@ -1,3 +1,10 @@
// Prevent eslint errors on functions defined in other files.
/*global
ExtraNetworksClusterizeTreeList,
ExtraNetworksClusterizeCardsList,
*/
/*eslint no-undef: "error"*/
const SEARCH_INPUT_DEBOUNCE_TIME_MS = 250;
const re_extranet = /<([^:^>]+:[^:]+):[\d.]+>(.*)/;
@ -23,7 +30,7 @@ const isStringLogError = x => {
console.error("expected string, got:", typeof x);
return false;
};
const isNull = x => typeof x === "null" || x === null;
const isNull = x => x === null;
const isUndefined = x => typeof x === "undefined" || x === undefined;
// checks both null and undefined for simplicity sake.
const isNullOrUndefined = x => isNull(x) || isUndefined(x);

View File

@ -1,3 +1,20 @@
// Prevent eslint errors on functions defined in other files.
/*global
isString,
isStringLogError,
isNull,
isUndefined,
isNullOrUndefined,
isNullOrUndefinedLogError,
isElement,
isElementLogError,
getElementByIdLogError,
querySelectorLogError,
waitForElement,
Clusterize
*/
/*eslint no-undef: "error"*/
const JSON_UPDATE_DEBOUNCE_TIME_MS = 250;
const RESIZE_DEBOUNCE_TIME_MS = 250;
// Collators used for sorting.
@ -89,15 +106,6 @@ const htmlStringToElement = function(str) {
return tmp.body.firstElementChild;
};
const getComputedValue = function(container, css_property) {
/** Gets a property value for the computed style of an element. */
return parseInt(
window.getComputedStyle(container, null)
.getPropertyValue(css_property)
.split("px")[0]
);
};
const calcColsPerRow = function(parent, child) {
/** Calculates the number of columns of children that can fit in a parent's visible width. */
const parent_inner_width = parent.offsetWidth - getComputedPaddingDims(parent).width;