From 86058d8f2532d09adc4e44e410c71cfe79289b0b Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Wed, 11 May 2022 16:21:22 -0700 Subject: [PATCH] default-param-last ignores for reducers --- src/account/accountsReducer.js | 1 + src/alertWords/alertWordsReducer.js | 2 +- src/caughtup/caughtUpReducer.js | 2 +- src/chat/fetchingReducer.js | 2 +- src/chat/flagsReducer.js | 2 +- src/chat/narrowsReducer.js | 2 +- src/drafts/draftsReducer.js | 2 +- src/message/messagesReducer.js | 2 +- src/mute/muteModel.js | 2 +- src/mute/mutedUsersReducer.js | 2 +- src/outbox/outboxReducer.js | 2 +- src/pm-conversations/pmConversationsModel.js | 2 +- src/presence/presenceReducer.js | 2 +- src/realm/realmReducer.js | 2 +- src/session/sessionReducer.js | 1 + src/settings/settingsReducer.js | 1 + src/streams/streamsReducer.js | 2 +- src/subscriptions/subscriptionsReducer.js | 2 +- src/topics/topicsReducer.js | 2 +- src/typing/typingReducer.js | 2 +- src/unread/unreadHuddlesReducer.js | 2 +- src/unread/unreadMentionsReducer.js | 2 +- src/unread/unreadModel.js | 2 +- src/unread/unreadPmsReducer.js | 2 +- src/user-groups/userGroupsReducer.js | 2 +- src/user-statuses/userStatusesModel.js | 2 +- src/users/usersReducer.js | 2 +- 27 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/account/accountsReducer.js b/src/account/accountsReducer.js index cfaef96eb8d..645433eacf2 100644 --- a/src/account/accountsReducer.js +++ b/src/account/accountsReducer.js @@ -102,6 +102,7 @@ const accountRemove = (state, action) => { return newState; }; +// eslint-disable-next-line default-param-last export default (state: AccountsState = initialState, action: Action): AccountsState => { switch (action.type) { case REGISTER_COMPLETE: diff --git a/src/alertWords/alertWordsReducer.js b/src/alertWords/alertWordsReducer.js index f6738a52a0e..a6b0f270591 100644 --- a/src/alertWords/alertWordsReducer.js +++ b/src/alertWords/alertWordsReducer.js @@ -6,7 +6,7 @@ import { NULL_ARRAY } from '../nullObjects'; const initialState = NULL_ARRAY; export default ( - state: AlertWordsState = initialState, + state: AlertWordsState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): AlertWordsState => { switch (action.type) { diff --git a/src/caughtup/caughtUpReducer.js b/src/caughtup/caughtUpReducer.js index a291a1c724a..a7a4c4ba97c 100644 --- a/src/caughtup/caughtUpReducer.js +++ b/src/caughtup/caughtUpReducer.js @@ -30,7 +30,7 @@ function addMessages(state: CaughtUpState, narrow, messageIds): CaughtUpState { } export default ( - state: CaughtUpState = initialState, + state: CaughtUpState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): CaughtUpState => { switch (action.type) { diff --git a/src/chat/fetchingReducer.js b/src/chat/fetchingReducer.js index 248cd872e69..47e0a384853 100644 --- a/src/chat/fetchingReducer.js +++ b/src/chat/fetchingReducer.js @@ -64,7 +64,7 @@ const messageFetchComplete = (state, action) => { }; export default ( - state: FetchingState = initialState, + state: FetchingState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): FetchingState => { switch (action.type) { diff --git a/src/chat/flagsReducer.js b/src/chat/flagsReducer.js index 25f4cfb64ed..235afb6aa0e 100644 --- a/src/chat/flagsReducer.js +++ b/src/chat/flagsReducer.js @@ -131,7 +131,7 @@ const eventUpdateMessageFlags = (state, action) => { }; export default ( - state: FlagsState = initialState, + state: FlagsState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): FlagsState => { switch (action.type) { diff --git a/src/chat/narrowsReducer.js b/src/chat/narrowsReducer.js index c521959e106..c220077d073 100644 --- a/src/chat/narrowsReducer.js +++ b/src/chat/narrowsReducer.js @@ -193,7 +193,7 @@ const eventUpdateMessageFlags = (state, action) => { }; export default ( - state: NarrowsState = initialState, + state: NarrowsState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): NarrowsState => { switch (action.type) { diff --git a/src/drafts/draftsReducer.js b/src/drafts/draftsReducer.js index 9f3110ee872..8a29287ec4f 100644 --- a/src/drafts/draftsReducer.js +++ b/src/drafts/draftsReducer.js @@ -23,7 +23,7 @@ const draftUpdate = (state, action) => { }; export default ( - state: DraftsState = initialState, + state: DraftsState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): DraftsState => { switch (action.type) { diff --git a/src/message/messagesReducer.js b/src/message/messagesReducer.js index 1a0cb993fd5..a712b69e123 100644 --- a/src/message/messagesReducer.js +++ b/src/message/messagesReducer.js @@ -65,7 +65,7 @@ const eventNewMessage = (state, action) => { }; export default ( - state: MessagesState = initialState, + state: MessagesState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, globalState: PerAccountState, ): MessagesState => { diff --git a/src/mute/muteModel.js b/src/mute/muteModel.js index e859be7e4d9..a8e4d604add 100644 --- a/src/mute/muteModel.js +++ b/src/mute/muteModel.js @@ -42,7 +42,7 @@ function convert(data, streams): MuteState { } export const reducer = ( - state: MuteState = initialState, + state: MuteState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, globalState: PerAccountState, ): MuteState => { diff --git a/src/mute/mutedUsersReducer.js b/src/mute/mutedUsersReducer.js index d84ef4cf61b..00777a80334 100644 --- a/src/mute/mutedUsersReducer.js +++ b/src/mute/mutedUsersReducer.js @@ -18,7 +18,7 @@ function mutedUsersToMap(muted_users: $ReadOnlyArray): Immutable.Map< } export default ( - state: MutedUsersState = initialState, + state: MutedUsersState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): MutedUsersState => { switch (action.type) { diff --git a/src/outbox/outboxReducer.js b/src/outbox/outboxReducer.js index ebae5403214..508d3cc5317 100644 --- a/src/outbox/outboxReducer.js +++ b/src/outbox/outboxReducer.js @@ -23,7 +23,7 @@ const messageSendStart = (state, action) => { }; export default ( - state: OutboxState = initialState, + state: OutboxState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): OutboxState => { switch (action.type) { diff --git a/src/pm-conversations/pmConversationsModel.js b/src/pm-conversations/pmConversationsModel.js index 392a00eeee0..81e24916be7 100644 --- a/src/pm-conversations/pmConversationsModel.js +++ b/src/pm-conversations/pmConversationsModel.js @@ -180,7 +180,7 @@ function insertMessage(state, message, ownUserId) { } export function reducer( - state: PmConversationsState = initialState, + state: PmConversationsState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): PmConversationsState { switch (action.type) { diff --git a/src/presence/presenceReducer.js b/src/presence/presenceReducer.js index 93c119f72ae..8d87ad96b8a 100644 --- a/src/presence/presenceReducer.js +++ b/src/presence/presenceReducer.js @@ -15,7 +15,7 @@ import { objectEntries } from '../flowPonyfill'; const initialState: PresenceState = NULL_OBJECT; export default ( - state: PresenceState = initialState, + state: PresenceState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): PresenceState => { switch (action.type) { diff --git a/src/realm/realmReducer.js b/src/realm/realmReducer.js index e0abf9cd22a..b6e8b231941 100644 --- a/src/realm/realmReducer.js +++ b/src/realm/realmReducer.js @@ -79,7 +79,7 @@ function getVideoChatProvider({ } export default ( - state: RealmState = initialState, + state: RealmState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): RealmState => { switch (action.type) { diff --git a/src/session/sessionReducer.js b/src/session/sessionReducer.js index 2b6508025c2..3a2794f1eca 100644 --- a/src/session/sessionReducer.js +++ b/src/session/sessionReducer.js @@ -164,6 +164,7 @@ const rehydrate = (state, action) => { }; }; +// eslint-disable-next-line default-param-last export default (state: SessionState = initialState, action: Action): SessionState => { switch (action.type) { case DEAD_QUEUE: diff --git a/src/settings/settingsReducer.js b/src/settings/settingsReducer.js index a921140a45b..4de9b8d62e9 100644 --- a/src/settings/settingsReducer.js +++ b/src/settings/settingsReducer.js @@ -20,6 +20,7 @@ const initialState: SettingsState = { doNotMarkMessagesAsRead: false, }; +// eslint-disable-next-line default-param-last export default (state: SettingsState = initialState, action: Action): SettingsState => { switch (action.type) { case REGISTER_COMPLETE: { diff --git a/src/streams/streamsReducer.js b/src/streams/streamsReducer.js index 2da46fd72d9..57d65ae38cb 100644 --- a/src/streams/streamsReducer.js +++ b/src/streams/streamsReducer.js @@ -52,7 +52,7 @@ export function updateStreamProperties( } export default ( - state: StreamsState = initialState, + state: StreamsState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): StreamsState => { switch (action.type) { diff --git a/src/subscriptions/subscriptionsReducer.js b/src/subscriptions/subscriptionsReducer.js index e8a5ee7fb4b..8f3f9a3c09e 100644 --- a/src/subscriptions/subscriptionsReducer.js +++ b/src/subscriptions/subscriptionsReducer.js @@ -17,7 +17,7 @@ import { filterArray } from '../utils/immutability'; const initialState: SubscriptionsState = NULL_ARRAY; export default ( - state: SubscriptionsState = initialState, + state: SubscriptionsState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): SubscriptionsState => { switch (action.type) { diff --git a/src/topics/topicsReducer.js b/src/topics/topicsReducer.js index 6a264215614..897c20b9775 100644 --- a/src/topics/topicsReducer.js +++ b/src/topics/topicsReducer.js @@ -37,7 +37,7 @@ const eventNewMessage = (state, action) => { }; export default ( - state: TopicsState = initialState, + state: TopicsState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): TopicsState => { switch (action.type) { diff --git a/src/typing/typingReducer.js b/src/typing/typingReducer.js index 196dfb96b85..45d5a8ec138 100644 --- a/src/typing/typingReducer.js +++ b/src/typing/typingReducer.js @@ -84,7 +84,7 @@ const clearTyping = (state, action) => { }; export default ( - state: TypingState = initialState, + state: TypingState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): TypingState => { switch (action.type) { diff --git a/src/unread/unreadHuddlesReducer.js b/src/unread/unreadHuddlesReducer.js index c24b40cfda3..64669086888 100644 --- a/src/unread/unreadHuddlesReducer.js +++ b/src/unread/unreadHuddlesReducer.js @@ -55,7 +55,7 @@ const eventUpdateMessageFlags = (state, action) => { }; export default ( - state: UnreadHuddlesState = initialState, + state: UnreadHuddlesState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): UnreadHuddlesState => { switch (action.type) { diff --git a/src/unread/unreadMentionsReducer.js b/src/unread/unreadMentionsReducer.js index cca0fd1cd68..2a67c90e8c5 100644 --- a/src/unread/unreadMentionsReducer.js +++ b/src/unread/unreadMentionsReducer.js @@ -35,7 +35,7 @@ const eventUpdateMessageFlags = (state, action) => { }; export default ( - state: UnreadMentionsState = initialState, + state: UnreadMentionsState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): UnreadMentionsState => { switch (action.type) { diff --git a/src/unread/unreadModel.js b/src/unread/unreadModel.js index 9448be2dd64..fa8f9d4570f 100644 --- a/src/unread/unreadModel.js +++ b/src/unread/unreadModel.js @@ -172,7 +172,7 @@ function deleteMessages( } function streamsReducer( - state: UnreadStreamsState = initialStreamsState, + state: UnreadStreamsState = initialStreamsState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, globalState: PerAccountState, ): UnreadStreamsState { diff --git a/src/unread/unreadPmsReducer.js b/src/unread/unreadPmsReducer.js index 0724ce1987b..3915c1723fc 100644 --- a/src/unread/unreadPmsReducer.js +++ b/src/unread/unreadPmsReducer.js @@ -53,7 +53,7 @@ const eventUpdateMessageFlags = (state, action) => { }; export default ( - state: UnreadPmsState = initialState, + state: UnreadPmsState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): UnreadPmsState => { switch (action.type) { diff --git a/src/user-groups/userGroupsReducer.js b/src/user-groups/userGroupsReducer.js index c13741dffb5..609898a05f9 100644 --- a/src/user-groups/userGroupsReducer.js +++ b/src/user-groups/userGroupsReducer.js @@ -46,7 +46,7 @@ const eventUserGroupRemoveMembers = (state, action) => ); export default ( - state: UserGroupsState = initialState, + state: UserGroupsState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): UserGroupsState => { switch (action.type) { diff --git a/src/user-statuses/userStatusesModel.js b/src/user-statuses/userStatusesModel.js index 4e93abe4832..b3ecf9261ef 100644 --- a/src/user-statuses/userStatusesModel.js +++ b/src/user-statuses/userStatusesModel.js @@ -61,7 +61,7 @@ function updateUserStatus( } export const reducer = ( - state: UserStatusesState = initialState, + state: UserStatusesState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): UserStatusesState => { switch (action.type) { diff --git a/src/users/usersReducer.js b/src/users/usersReducer.js index c8f09f6f0c3..900fd36de57 100644 --- a/src/users/usersReducer.js +++ b/src/users/usersReducer.js @@ -15,7 +15,7 @@ import { NULL_ARRAY } from '../nullObjects'; const initialState: UsersState = NULL_ARRAY; export default ( - state: UsersState = initialState, + state: UsersState = initialState, // eslint-disable-line default-param-last action: PerAccountApplicableAction, ): UsersState => { switch (action.type) {