mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 02:15:01 +00:00
Enable more lints (#1330)
This commit is contained in:
parent
d159308352
commit
b00e359a78
6 changed files with 18 additions and 7 deletions
|
|
@ -23,6 +23,11 @@
|
||||||
"rules": {
|
"rules": {
|
||||||
"prettier/prettier": "error",
|
"prettier/prettier": "error",
|
||||||
"no-constant-binary-expression": "error",
|
"no-constant-binary-expression": "error",
|
||||||
|
"array-callback-return": "error",
|
||||||
|
"no-template-curly-in-string": "error",
|
||||||
|
"no-promise-executor-return": "error",
|
||||||
|
"no-constructor-return": "error",
|
||||||
|
"no-unsafe-optional-chaining": "error",
|
||||||
"block-scoped-var": "warn",
|
"block-scoped-var": "warn",
|
||||||
"camelcase": "error",
|
"camelcase": "error",
|
||||||
"constructor-super": "error",
|
"constructor-super": "error",
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,9 @@ const ONE_MINUTE_IN_MS = 1000 * 60;
|
||||||
function timeout<T>(p: Promise<T>, duration: number): Promise<T> {
|
function timeout<T>(p: Promise<T>, duration: number): Promise<T> {
|
||||||
return Promise.race([
|
return Promise.race([
|
||||||
p,
|
p,
|
||||||
new Promise<never>((resolve, reject) =>
|
new Promise<never>((_resolve, reject) => {
|
||||||
setTimeout(() => reject("timeout"), duration)
|
setTimeout(() => reject("timeout"), duration);
|
||||||
),
|
}),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,9 @@ export async function upload(fileObj) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`Request to ${uploadUrl} returned 503, going to retry again in 5 seconds. ${retries} retries left...`
|
`Request to ${uploadUrl} returned 503, going to retry again in 5 seconds. ${retries} retries left...`
|
||||||
);
|
);
|
||||||
await new Promise((resolve) => setTimeout(resolve, 5000));
|
await new Promise((resolve) => {
|
||||||
|
setTimeout(resolve, 5000);
|
||||||
|
});
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ const getCssRules = createSelector(
|
||||||
}
|
}
|
||||||
const cursorRules = cursorSelector
|
const cursorRules = cursorSelector
|
||||||
.map(normalizeCursorSelector)
|
.map(normalizeCursorSelector)
|
||||||
.map((selector) => {
|
.map((selector): string | null => {
|
||||||
switch (cursor.type) {
|
switch (cursor.type) {
|
||||||
case "cur":
|
case "cur":
|
||||||
return `${selector} {cursor: url(${cursor.url}), auto}`;
|
return `${selector} {cursor: url(${cursor.url}), auto}`;
|
||||||
|
|
@ -101,6 +101,8 @@ const getCssRules = createSelector(
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ export const parseViscolors = (text: string): string[] => {
|
||||||
.map((line) => regex.exec(line))
|
.map((line) => regex.exec(line))
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.map((matches) => (matches as RegExpExecArray).slice(1, 4).join(","))
|
.map((matches) => (matches as RegExpExecArray).slice(1, 4).join(","))
|
||||||
.map((rgb, i) => {
|
.forEach((rgb, i) => {
|
||||||
colors[i] = `rgb(${rgb})`;
|
colors[i] = `rgb(${rgb})`;
|
||||||
});
|
});
|
||||||
return colors;
|
return colors;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,9 @@ import puppeteer from "puppeteer";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TODO: Wait for node to be ready
|
// TODO: Wait for node to be ready
|
||||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
await new Promise((resolve) => {
|
||||||
|
setTimeout(resolve, 500);
|
||||||
|
});
|
||||||
try {
|
try {
|
||||||
const css: string = await page.evaluate(
|
const css: string = await page.evaluate(
|
||||||
() => document.getElementById("webamp-skin")?.innerText || ""
|
() => document.getElementById("webamp-skin")?.innerText || ""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue