Skip to content

Commit

Permalink
refactor(frontend): fix all linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mikonse committed Jan 2, 2024
1 parent 85e2d55 commit 4fd07ad
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion frontend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
"rules": {
"@typescript-eslint/no-explicit-any": ["warn"]
}
},
{
"files": ["*.js", "*.jsx"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import memoize from "proxy-memoize";
import * as React from "react";
import { useState } from "react";
import { ScrollView } from "react-native";
import { Button, Checkbox, Dialog, List, Text, Searchbar } from "react-native-paper";
import { Button, Checkbox, Dialog, List, Searchbar } from "react-native-paper";
import { getAccountIcon } from "../../constants/Icons";
import { RootState, selectAccountSlice, useAppSelector } from "../../store";
import { KeyboardAvoidingDialog } from "../style/KeyboardAvoidingDialog";
Expand Down
1 change: 0 additions & 1 deletion frontend/apps/mobile/src/screens/groups/AccountDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { ScrollView, StyleSheet, View } from "react-native";
import {
ActivityIndicator,
Button,
Chip,
Dialog,
Divider,
IconButton,
Expand Down
3 changes: 1 addition & 2 deletions frontend/apps/web/src/components/ShareSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ import {
useMediaQuery,
useTheme,
} from "@mui/material";
import memoize from "proxy-memoize";
import * as React from "react";
import { Link } from "react-router-dom";
import { RootState, selectAccountSlice, useAppSelector } from "../store";
import { selectAccountSlice, useAppSelector } from "../store";
import { getAccountLink } from "../utils";
import { NumericInput } from "./NumericInput";
import { getAccountIcon } from "./style/AbrechnungIcons";
Expand Down
1 change: 1 addition & 0 deletions frontend/libs/api/src/lib/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type SubscriptionCallback = (payload: NotificationPayload) => void;

const parseNotificationPayload = (
subscriptionType: SubscriptionType,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
payload: any
): NotificationPayload | undefined => {
switch (subscriptionType) {
Expand Down
1 change: 1 addition & 0 deletions frontend/libs/core/src/lib/events.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type EventMap = Record<string, any>;
type EventKey<T extends EventMap> = string & keyof T;
type EventReceiver<T> = (params: T) => void;
Expand Down
1 change: 1 addition & 0 deletions frontend/libs/redux/src/lib/auth/authSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const logout = createAsyncThunk<void, { api: Api }>("logout", async ({ ap
api.resetAuthState();
dispatch({
type: PURGE,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
result: (purgeResult: any) => {
console.log("successfully purged state", purgeResult);
return;
Expand Down
4 changes: 4 additions & 0 deletions frontend/libs/redux/src/lib/persistance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,22 @@ export const getAbrechnungReducer = <S, A extends Action = AnyAction>(
) => {
return combineReducers({
accounts: persistReducer(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
getPersistConfig("accounts", accountSliceVersion, persistStorage, accountMigrations as any),
accountReducer
),
groups: persistReducer(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
getPersistConfig("groups", groupSliceVersion, persistStorage, groupMigrations as any),
groupReducer
),
transactions: persistReducer(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
getPersistConfig("transactions", transactionSliceVersion, persistStorage, transactionMigrations as any),
transactionReducer
),
auth: persistReducer(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
getPersistConfig("auth", authSliceVersion, persistStorage, authMigrations as any),
authReducer
),
Expand Down
1 change: 1 addition & 0 deletions frontend/libs/redux/src/lib/thunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const fetchGroupDependencies = createAsyncThunk<
export const clearCache = createAsyncThunk<void, void>("clearCache", async (args, { dispatch }) => {
dispatch({
type: PURGE,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
result: (purgeResult: any) => {
return;
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/libs/utils/src/lib/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const urlValidator = (url: string) => {
if (!url || url.length <= 0) return "URL cannot be empty.";

try {
const tmp = new URL(url);
new URL(url);
} catch (_) {
return "Invalid URL";
}
Expand Down

0 comments on commit 4fd07ad

Please sign in to comment.