mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2026-09-02 21:04:08 +03:00
chore: disable aggressive unicorn rules, manual fix for promise-related errors
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
@@ -110,6 +110,8 @@ export function getBaseConfig(packageName: string, forceCache = !CI_environment,
|
||||
'unicorn/explicit-length-check': 'off',
|
||||
'unicorn/comment-content': 'off',
|
||||
'unicorn/no-top-level-side-effects': 'off',
|
||||
'unicorn/name-replacements': 'off',
|
||||
'unicorn/consistent-boolean-name': 'off',
|
||||
'@stylistic/padding-line-between-statements': [
|
||||
'error',
|
||||
// Always require blank lines after import, except between imports
|
||||
|
||||
@@ -11,11 +11,14 @@ export class PromiseQueue {
|
||||
return new Promise<T>((resolve, reject) => {
|
||||
const run = () => {
|
||||
this.activeCount++;
|
||||
/* eslint-disable promise/prefer-await-to-then, promise/catch-or-return */
|
||||
task()
|
||||
.then(resolve)
|
||||
.catch(reject)
|
||||
.finally(() => {
|
||||
void (async () => {
|
||||
try {
|
||||
const result = await task();
|
||||
|
||||
resolve(result);
|
||||
} catch (error) {
|
||||
reject(error instanceof Error ? error : new Error(String(error)));
|
||||
} finally {
|
||||
this.activeCount--;
|
||||
|
||||
const next = this.queue.shift();
|
||||
@@ -23,8 +26,8 @@ export class PromiseQueue {
|
||||
if (next) {
|
||||
next();
|
||||
}
|
||||
});
|
||||
/* eslint-enable promise/prefer-await-to-then, promise/catch-or-return */
|
||||
}
|
||||
})();
|
||||
};
|
||||
|
||||
if (this.activeCount < this.concurrency) {
|
||||
|
||||
Reference in New Issue
Block a user