1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Enable ESLlint no-case-declarations

This commit is contained in:
Nick Schonning 2024-06-19 14:54:26 -04:00
parent 2cda1dd542
commit e8ef51ea07
No known key found for this signature in database
GPG key ID: 5DDAAD9C9AAFFD9F
4 changed files with 6 additions and 4 deletions

View file

@ -64,7 +64,6 @@ module.exports = defineConfig({
'indent': ['error', 2],
'jsx-quotes': ['error', 'prefer-single'],
'semi': ['error', 'always'],
'no-case-declarations': 'off',
'no-catch-shadow': 'error',
'no-console': [
'warn',

View file

@ -406,7 +406,7 @@ export default function compose(state = initialState, action) {
return item;
}));
case INIT_MEDIA_EDIT_MODAL:
case INIT_MEDIA_EDIT_MODAL: {
const media = state.get('media_attachments').find(item => item.get('id') === action.id);
return state.set('media_modal', ImmutableMap({
id: action.id,
@ -415,6 +415,7 @@ export default function compose(state = initialState, action) {
focusY: media.getIn(['meta', 'focus', 'y'], 0),
dirty: false,
}));
}
case COMPOSE_CHANGE_MEDIA_DESCRIPTION:
return state.setIn(['media_modal', 'description'], action.description).setIn(['media_modal', 'dirty'], true);
case COMPOSE_CHANGE_MEDIA_FOCUS:

View file

@ -297,9 +297,10 @@ export default function notifications(state = initialState, action) {
return action.timeline === 'home' ?
state.update(action.usePendingItems ? 'pendingItems' : 'items', items => items.first() ? items.unshift(null) : items) :
state;
case NOTIFICATIONS_MARK_AS_READ:
case NOTIFICATIONS_MARK_AS_READ: {
const lastNotification = state.get('items').find(item => item !== null);
return lastNotification ? recountUnread(state, lastNotification.get('id')) : state;
}
case NOTIFICATIONS_SET_BROWSER_SUPPORT:
return state.set('browserSupport', action.value);
case NOTIFICATIONS_SET_BROWSER_PERMISSION:

View file

@ -72,9 +72,10 @@ export default function search(state = initialState, action) {
});
case SEARCH_EXPAND_REQUEST:
return state.set('type', action.searchType).set('isLoading', true);
case SEARCH_EXPAND_SUCCESS:
case SEARCH_EXPAND_SUCCESS: {
const results = action.searchType === 'hashtags' ? ImmutableOrderedSet(fromJS(action.results.hashtags)) : action.results[action.searchType].map(item => item.id);
return state.updateIn(['results', action.searchType], list => list.union(results)).set('isLoading', false);
}
case SEARCH_HISTORY_UPDATE:
return state.set('recent', ImmutableOrderedSet(fromJS(action.recent)));
default: