mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 02:15:01 +00:00
Enable more lints
This commit is contained in:
parent
d159308352
commit
91db1c27a4
6 changed files with 18 additions and 7 deletions
|
|
@ -23,6 +23,11 @@
|
|||
"rules": {
|
||||
"prettier/prettier": "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",
|
||||
"camelcase": "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> {
|
||||
return Promise.race([
|
||||
p,
|
||||
new Promise<never>((resolve, reject) =>
|
||||
setTimeout(() => reject("timeout"), duration)
|
||||
),
|
||||
new Promise<never>((_resolve, reject) => {
|
||||
setTimeout(() => reject("timeout"), duration);
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ export async function upload(fileObj) {
|
|||
console.warn(
|
||||
`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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ const getCssRules = createSelector(
|
|||
}
|
||||
const cursorRules = cursorSelector
|
||||
.map(normalizeCursorSelector)
|
||||
.map((selector) => {
|
||||
.map((selector): string | null => {
|
||||
switch (cursor.type) {
|
||||
case "cur":
|
||||
return `${selector} {cursor: url(${cursor.url}), auto}`;
|
||||
|
|
@ -101,6 +101,8 @@ const getCssRules = createSelector(
|
|||
return null;
|
||||
}
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(Boolean);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ export const parseViscolors = (text: string): string[] => {
|
|||
.map((line) => regex.exec(line))
|
||||
.filter(Boolean)
|
||||
.map((matches) => (matches as RegExpExecArray).slice(1, 4).join(","))
|
||||
.map((rgb, i) => {
|
||||
.forEach((rgb, i) => {
|
||||
colors[i] = `rgb(${rgb})`;
|
||||
});
|
||||
return colors;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@ import puppeteer from "puppeteer";
|
|||
return;
|
||||
}
|
||||
// TODO: Wait for node to be ready
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
await new Promise((resolve) => {
|
||||
setTimeout(resolve, 500);
|
||||
});
|
||||
try {
|
||||
const css: string = await page.evaluate(
|
||||
() => document.getElementById("webamp-skin")?.innerText || ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue