mirror of
https://github.com/KevinMidboe/seasoned.git
synced 2026-03-11 11:55:38 +00:00
Resolved ALL eslint issues for project
This commit is contained in:
@@ -5,6 +5,7 @@ const state: IStateDarkmode = {
|
||||
userChoice: undefined
|
||||
};
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
|
||||
@@ -3,6 +3,7 @@ import type IStateDocumentTitle from "../interfaces/IStateDocumentTitle";
|
||||
const capitalize = (string: string) => {
|
||||
if (!string) return;
|
||||
|
||||
/* eslint-disable-next-line consistent-return */
|
||||
return string.includes(" ")
|
||||
? string
|
||||
.split(" ")
|
||||
@@ -25,6 +26,7 @@ const state: IStateDocumentTitle = {
|
||||
title: undefined
|
||||
};
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-shadow, no-return-assign */
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
@@ -42,10 +44,10 @@ export default {
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
updateEmoji({ commit }, emoji: String) {
|
||||
updateEmoji({ commit }, emoji: string) {
|
||||
commit("SET_EMOJI", emoji);
|
||||
},
|
||||
updateTitle({ commit }, title: String) {
|
||||
updateTitle({ commit }, title: string) {
|
||||
commit("SET_TITLE", title);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ const state: IStateHamburger = {
|
||||
open: false
|
||||
};
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-shadow, no-return-assign */
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import router from "../routes";
|
||||
import { MediaTypes } from "../interfaces/IList";
|
||||
import type { IStatePopup } from "../interfaces/IStatePopup";
|
||||
import type { IStatePopup, IPopupQuery } from "../interfaces/IStatePopup";
|
||||
|
||||
/* eslint-disable-next-line import/no-cycle */
|
||||
import router from "../routes";
|
||||
|
||||
const removeIncludedQueryParams = (params, key) => {
|
||||
if (params.has(key)) params.delete(key);
|
||||
@@ -9,11 +11,9 @@ const removeIncludedQueryParams = (params, key) => {
|
||||
|
||||
function paramsToObject(entries) {
|
||||
const result = {};
|
||||
for (const [key, value] of entries) {
|
||||
// each 'entry' is a [key, value] tupple
|
||||
return entries.forEach((key, value) => {
|
||||
result[key] = value;
|
||||
}
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
const updateQueryParams = (id: number = null, type: MediaTypes = null) => {
|
||||
@@ -38,6 +38,7 @@ const state: IStatePopup = {
|
||||
open: false
|
||||
};
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
@@ -60,7 +61,10 @@ export default {
|
||||
},
|
||||
actions: {
|
||||
open: ({ commit }, { id, type }: { id: number; type: MediaTypes }) => {
|
||||
if (!isNaN(id)) id = Number(id);
|
||||
if (!Number.isNaN(id)) {
|
||||
id = Number(id); /* eslint-disable-line no-param-reassign */
|
||||
}
|
||||
|
||||
commit("SET_OPEN", { id, type });
|
||||
updateQueryParams(id, type);
|
||||
},
|
||||
@@ -68,11 +72,11 @@ export default {
|
||||
commit("SET_CLOSE");
|
||||
updateQueryParams(); // reset
|
||||
},
|
||||
resetStateFromUrlQuery: ({ commit }, query: any) => {
|
||||
resetStateFromUrlQuery: ({ commit }, query: IPopupQuery) => {
|
||||
let { movie, show, person } = query;
|
||||
movie = !isNaN(movie) ? Number(movie) : movie;
|
||||
show = !isNaN(show) ? Number(show) : show;
|
||||
person = !isNaN(person) ? Number(person) : person;
|
||||
movie = !Number.isNaN(movie) ? Number(movie) : movie;
|
||||
show = !Number.isNaN(show) ? Number(show) : show;
|
||||
person = !Number.isNaN(person) ? Number(person) : person;
|
||||
|
||||
if (movie) commit("SET_OPEN", { id: movie, type: "movie" });
|
||||
else if (show) commit("SET_OPEN", { id: show, type: "show" });
|
||||
|
||||
@@ -6,12 +6,10 @@ const state: IStateTorrent = {
|
||||
resultCount: null
|
||||
};
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-shadow */
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
results: [],
|
||||
resultCount: null
|
||||
},
|
||||
state,
|
||||
getters: {
|
||||
results: (state: IStateTorrent) => {
|
||||
return state.results;
|
||||
|
||||
@@ -56,6 +56,7 @@ export default {
|
||||
username: state => state.username,
|
||||
settings: state => state.settings,
|
||||
token: state => state.token,
|
||||
// loggedIn: state => true,
|
||||
loggedIn: state => state && state.username !== null,
|
||||
admin: state => state.admin,
|
||||
plexId: state => {
|
||||
|
||||
Reference in New Issue
Block a user