refactor: fix misused promises (#2294)

Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
This commit is contained in:
Fernando Fernández
2024-04-09 16:51:25 +00:00
committed by GitHub
parent 2d17eb7adb
commit fd52f8941b
7 changed files with 9 additions and 23 deletions
+1
View File
@@ -42,6 +42,7 @@
"vue.format.style.initialIndent": true,
"vue.inlayHints.inlineHandlerLeading": true,
"vue.inlayHints.vBindShorthand": true,
"vue.server.hybridMode": false,
"sonarlint.output.showAnalyzerLogs": true,
"sonarlint.output.showVerboseLogs": true,
"sonarlint.connectedMode.project": {
-2
View File
@@ -4,8 +4,6 @@ const CI_environment = process.env.CI ? 0 : 1;
const commonTSAndVueConfig = {
extends: ['plugin:@typescript-eslint/recommended-requiring-type-checking'],
rules: {
// TODO: Investigate why this rule reports false positives
'@typescript-eslint/no-misused-promises': 'off',
'no-secrets/no-secrets': 'error',
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/no-redundant-type-constituents': 'off'
@@ -22,8 +22,8 @@ const searchQuery = computed({
get(): string {
return route.query.q?.toString() ?? '';
},
async set(value) {
await router.replace({
set(value) {
void router.replace({
...router.currentRoute,
query: {
q: value.trim() || undefined
+1 -3
View File
@@ -303,9 +303,7 @@ function _sharedInternalLogic<T extends Record<K, (...args: any[]) => any>, K ex
* mounted. setTimeout executes it when the event loop is clear, avoiding overwhelming the engine.
*/
if (isCached.value) {
window.setTimeout(async () => {
await run({ isRefresh: true });
});
void run({ isRefresh: true });
}
if (!isCached.value && isFuncDefined()) {
+1 -1
View File
@@ -309,7 +309,7 @@ class RemotePluginAuth {
}
public constructor() {
window.setTimeout(async () => await this.refreshCurrentUserInfo());
void this.refreshCurrentUserInfo();
}
}
+3 -8
View File
@@ -61,14 +61,9 @@ router.back = (): ReturnType<typeof router.back> => {
route.value.meta.transition.leave = leaveTransition;
}
window.setTimeout(
async () =>
await router.replace(
isStr(router.options.history.state.back)
? router.options.history.state.back
: '/'
)
);
void router.replace(isStr(router.options.history.state.back)
? router.options.history.state.back
: '/');
};
/**
+1 -7
View File
@@ -694,13 +694,7 @@ class PlaybackManagerStore extends CommonStore<PlaybackManagerState> {
this._reset();
this.currentVolume = volume;
window.setTimeout(async () => {
try {
if (sessionId && itemId && time && remote.auth.currentUser) {
await this._reportPlaybackStopped(itemId, sessionId, time);
}
} catch {}
});
void this._reportPlaybackStopped(itemId, sessionId, time);
};
/**