diff options
author | Renaud Chaput <renchap@gmail.com> | 2024-04-26 19:11:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-26 17:11:27 +0000 |
commit | 65093c619fdd1b18a4cf0c288051d8c524d5f434 (patch) | |
tree | 6c31a8671919e79cbbfecabee78fd697a18eae70 | |
parent | de4a7bf53159f72a9a122bf8df21e8d5f4ad7512 (diff) |
Fix marker thunks to not ignore eslint directives for the whole file (#30089)
-rw-r--r-- | app/javascript/mastodon/actions/markers.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/javascript/mastodon/actions/markers.ts b/app/javascript/mastodon/actions/markers.ts index 84e5b33bcc0..6ecc867169f 100644 --- a/app/javascript/mastodon/actions/markers.ts +++ b/app/javascript/mastodon/actions/markers.ts @@ -3,7 +3,7 @@ import { List as ImmutableList } from 'immutable'; import { debounce } from 'lodash'; import type { MarkerJSON } from 'mastodon/api_types/markers'; -import type { RootState } from 'mastodon/store'; +import type { AppDispatch, RootState } from 'mastodon/store'; import { createAppAsyncThunk } from 'mastodon/store/typed_functions'; import api, { authorizationTokenFromState } from '../api'; @@ -72,18 +72,21 @@ interface MarkerParam { } function getLastHomeId(state: RootState): string | undefined { - /* eslint-disable @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */ + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return ( + // eslint-disable-next-line @typescript-eslint/no-unsafe-call state // @ts-expect-error state.timelines is not yet typed .getIn(['timelines', 'home', 'items'], ImmutableList()) // @ts-expect-error state.timelines is not yet typed + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access .find((item) => item !== null) ); } function getLastNotificationId(state: RootState): string | undefined { // @ts-expect-error state.notifications is not yet typed + // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call return state.getIn(['notifications', 'lastReadId']); } @@ -131,8 +134,8 @@ export const submitMarkersAction = createAppAsyncThunk<{ }); const debouncedSubmitMarkers = debounce( - (dispatch) => { - dispatch(submitMarkersAction()); + (dispatch: AppDispatch) => { + void dispatch(submitMarkersAction()); }, 300000, { |