Unverified Commit 27a5b77f authored by Jesse Hallam's avatar Jesse Hallam Committed by GitHub
Browse files

update eslint's `comma-dangle` rule to `always-multiline`. (#830)

* update eslint's `comma-dangle` rule to `always-multiline`

* Invoke `yarn fix` to adopt the updated eslint rules. No other changes are included.
parent e93497b5
......@@ -45,7 +45,7 @@
"camelcase": [2, {"properties": "never"}],
"capitalized-comments": 0,
"class-methods-use-this": 0,
"comma-dangle": [2, "never"],
"comma-dangle": [2, "always-multiline"],
"comma-spacing": [2, {"before": false, "after": true}],
"comma-style": [2, "last"],
"complexity": [1, 10],
......
......@@ -283,20 +283,20 @@ export async function elasticsearchPurgeIndexes(success, error) {
export function setNavigationBlocked(blocked) {
return {
type: ActionTypes.SET_NAVIGATION_BLOCKED,
blocked
blocked,
};
}
export function deferNavigation(onNavigationConfirmed) {
return {
type: ActionTypes.DEFER_NAVIGATION,
onNavigationConfirmed
onNavigationConfirmed,
};
}
export function cancelNavigation() {
return {
type: ActionTypes.CANCEL_NAVIGATION
type: ActionTypes.CANCEL_NAVIGATION,
};
}
......@@ -310,7 +310,7 @@ export function confirmNavigation() {
}
thunkDispatch({
type: ActionTypes.CONFIRM_NAVIGATION
type: ActionTypes.CONFIRM_NAVIGATION,
});
};
}
......@@ -205,7 +205,7 @@ export async function openDirectChannelToUser(userId, success, error) {
const currentUserId = UserStore.getCurrentId();
savePreferences(currentUserId, [
{user_id: currentUserId, category: Preferences.CATEGORY_DIRECT_CHANNEL_SHOW, name: userId, value: 'true'},
{user_id: currentUserId, category: Preferences.CATEGORY_CHANNEL_OPEN_TIME, name: channel.id, value: now.toString()}
{user_id: currentUserId, category: Preferences.CATEGORY_CHANNEL_OPEN_TIME, name: channel.id, value: now.toString()},
])(dispatch, getState);
if (success) {
......@@ -248,7 +248,7 @@ export function unmarkFavorite(channelId) {
const pref = {
user_id: currentUserId,
category: Preferences.CATEGORY_FAVORITE_CHANNEL,
name: channelId
name: channelId,
};
deletePreferences(currentUserId, [pref])(dispatch, getState);
......
......@@ -9,7 +9,7 @@ const SUPPORTS_MEASURE_METHODS = isSupported([
performance.measure,
performance.getEntries,
performance.getEntriesByName,
performance.clearMeasures
performance.clearMeasures,
]);
export function trackEvent(category, event, props) {
......@@ -17,16 +17,16 @@ export function trackEvent(category, event, props) {
const properties = Object.assign({category, type: event, user_actual_id: UserStore.getCurrentId()}, props);
const options = {
context: {
ip: '0.0.0.0'
ip: '0.0.0.0',
},
page: {
path: '',
referrer: '',
search: '',
title: '',
url: ''
url: '',
},
anonymousId: '00000000000000000000000000'
anonymousId: '00000000000000000000000000',
};
global.window.analytics.track('event', properties, options);
}
......
......@@ -26,7 +26,7 @@ export async function deleteEmoji(emojiId, success, error) {
// Needed to remove recently used emoji
AppDispatcher.handleServerAction({
type: ActionTypes.REMOVED_CUSTOM_EMOJI,
id: emojiId
id: emojiId,
});
if (success) {
......@@ -58,7 +58,7 @@ export function loadRecentlyUsedCustomEmojis() {
export function incrementEmojiPickerPage() {
return async (dispatch) => {
dispatch({
type: ActionTypes.INCREMENT_EMOJI_PICKER_PAGE
type: ActionTypes.INCREMENT_EMOJI_PICKER_PAGE,
});
return {data: true};
......
......@@ -32,7 +32,7 @@ export function uploadFile(file, name, channelId, clientId, successCallback, err
clientIds: [clientId],
channelId,
rootId: null,
error: err
error: err,
};
dispatch(batchActions([failure, getLogErrorAction(err)]), getState);
......@@ -44,7 +44,7 @@ export function uploadFile(file, name, channelId, clientId, successCallback, err
const data = res.body.file_infos.map((fileInfo, index) => {
return {
...fileInfo,
clientId: res.body.client_ids[index]
clientId: res.body.client_ids[index],
};
});
......@@ -53,11 +53,11 @@ export function uploadFile(file, name, channelId, clientId, successCallback, err
type: FileTypes.RECEIVED_UPLOAD_FILES,
data,
channelId,
rootId: null
rootId: null,
},
{
type: FileTypes.UPLOAD_FILES_SUCCESS
}
type: FileTypes.UPLOAD_FILES_SUCCESS,
},
]), getState);
if (successCallback) {
......
......@@ -8,7 +8,7 @@ import {
getMyChannelMember,
joinChannel,
markChannelAsRead,
selectChannel
selectChannel,
} from 'mattermost-redux/actions/channels';
import {getPostThread} from 'mattermost-redux/actions/posts';
import {removeUserFromTeam} from 'mattermost-redux/actions/teams';
......@@ -70,7 +70,7 @@ export function emitChannelClickEvent(channel) {
AppDispatcher.handleViewAction({
type: ActionTypes.CLICK_CHANNEL,
id: chan.id,
team_id: chan.team_id
team_id: chan.team_id,
});
}
......@@ -94,12 +94,12 @@ export async function doFocusPost(channelId, postId, data) {
type: ActionTypes.RECEIVED_FOCUSED_POST,
postId,
channelId,
post_list: data
post_list: data,
});
dispatch({
type: ActionTypes.RECEIVED_FOCUSED_POST,
data: postId
data: postId,
});
const member = getState().entities.channels.myMembers[channelId];
......@@ -142,28 +142,28 @@ export function emitLeaveTeam() {
export function emitUserPostedEvent(post) {
AppDispatcher.handleServerAction({
type: ActionTypes.CREATE_POST,
post
post,
});
}
export function emitUserCommentedEvent(post) {
AppDispatcher.handleServerAction({
type: ActionTypes.CREATE_COMMENT,
post
post,
});
}
export function showAccountSettingsModal() {
AppDispatcher.handleViewAction({
type: ActionTypes.TOGGLE_ACCOUNT_SETTINGS_MODAL,
value: true
value: true,
});
}
export function toggleShortcutsModal() {
AppDispatcher.handleViewAction({
type: ActionTypes.TOGGLE_SHORTCUTS_MODAL,
value: true
value: true,
});
}
......@@ -172,7 +172,7 @@ export function showDeletePostModal(post, commentCount = 0) {
type: ActionTypes.TOGGLE_DELETE_POST_MODAL,
value: true,
post,
commentCount
commentCount,
});
}
......@@ -180,7 +180,7 @@ export function showChannelHeaderUpdateModal(channel) {
AppDispatcher.handleViewAction({
type: ActionTypes.TOGGLE_CHANNEL_HEADER_UPDATE_MODAL,
value: true,
channel
channel,
});
}
......@@ -188,7 +188,7 @@ export function showChannelPurposeUpdateModal(channel) {
AppDispatcher.handleViewAction({
type: ActionTypes.TOGGLE_CHANNEL_PURPOSE_UPDATE_MODAL,
value: true,
channel
channel,
});
}
......@@ -196,7 +196,7 @@ export function showChannelNameUpdateModal(channel) {
AppDispatcher.handleViewAction({
type: ActionTypes.TOGGLE_CHANNEL_NAME_UPDATE_MODAL,
value: true,
channel
channel,
});
}
......@@ -204,7 +204,7 @@ export function showGetPostLinkModal(post) {
AppDispatcher.handleViewAction({
type: ActionTypes.TOGGLE_GET_POST_LINK_MODAL,
value: true,
post
post,
});
}
......@@ -212,35 +212,35 @@ export function showGetPublicLinkModal(fileId) {
AppDispatcher.handleViewAction({
type: ActionTypes.TOGGLE_GET_PUBLIC_LINK_MODAL,
value: true,
fileId
fileId,
});
}
export function showGetTeamInviteLinkModal() {
AppDispatcher.handleViewAction({
type: Constants.ActionTypes.TOGGLE_GET_TEAM_INVITE_LINK_MODAL,
value: true
value: true,
});
}
export function showInviteMemberModal() {
AppDispatcher.handleViewAction({
type: ActionTypes.TOGGLE_INVITE_MEMBER_MODAL,
value: true
value: true,
});
}
export function showLeaveTeamModal() {
AppDispatcher.handleViewAction({
type: ActionTypes.TOGGLE_LEAVE_TEAM_MODAL,
value: true
value: true,
});
}
export function showLeavePrivateChannelModal(channel) {
AppDispatcher.handleViewAction({
type: ActionTypes.TOGGLE_LEAVE_PRIVATE_CHANNEL_MODAL,
value: channel
value: channel,
});
}
......@@ -248,21 +248,21 @@ export function emitSuggestionPretextChanged(suggestionId, pretext) {
AppDispatcher.handleViewAction({
type: ActionTypes.SUGGESTION_PRETEXT_CHANGED,
id: suggestionId,
pretext
pretext,
});
}
export function emitSelectNextSuggestion(suggestionId) {
AppDispatcher.handleViewAction({
type: ActionTypes.SUGGESTION_SELECT_NEXT,
id: suggestionId
id: suggestionId,
});
}
export function emitSelectPreviousSuggestion(suggestionId) {
AppDispatcher.handleViewAction({
type: ActionTypes.SUGGESTION_SELECT_PREVIOUS,
id: suggestionId
id: suggestionId,
});
}
......@@ -270,21 +270,21 @@ export function emitCompleteWordSuggestion(suggestionId, term = '') {
AppDispatcher.handleViewAction({
type: Constants.ActionTypes.SUGGESTION_COMPLETE_WORD,
id: suggestionId,
term
term,
});
}
export function emitClearSuggestions(suggestionId) {
AppDispatcher.handleViewAction({
type: Constants.ActionTypes.SUGGESTION_CLEAR_SUGGESTIONS,
id: suggestionId
id: suggestionId,
});
}
export function emitPreferenceChangedEvent(preference) {
AppDispatcher.handleServerAction({
type: Constants.ActionTypes.RECEIVED_PREFERENCE,
preference
preference,
});
if (addedNewDmUser(preference)) {
......@@ -295,7 +295,7 @@ export function emitPreferenceChangedEvent(preference) {
export function emitPreferencesChangedEvent(preferences) {
AppDispatcher.handleServerAction({
type: Constants.ActionTypes.RECEIVED_PREFERENCES,
preferences
preferences,
});
if (preferences.findIndex(addedNewDmUser) !== -1) {
......@@ -310,7 +310,7 @@ function addedNewDmUser(preference) {
export function emitPreferencesDeletedEvent(preferences) {
AppDispatcher.handleServerAction({
type: Constants.ActionTypes.DELETED_PREFERENCES,
preferences
preferences,
});
}
......@@ -326,7 +326,7 @@ export function sendEphemeralPost(message, channelId, parentId) {
update_at: timestamp,
root_id: parentId,
parent_id: parentId,
props: {}
props: {},
};
handleNewPost(post);
......@@ -346,8 +346,8 @@ export function sendAddToChannelEphemeralPost(user, addedUsername, channelId, po
parent_id: postRootId,
props: {
username: user.username,
addedUsername
}
addedUsername,
},
};
handleNewPost(post);
......@@ -360,7 +360,7 @@ export function newLocalizationSelected(locale) {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_LOCALE,
locale,
translations: en
translations: en,
});
} else {
Client4.getTranslations(localeInfo.url).then(
......@@ -372,7 +372,7 @@ export function newLocalizationSelected(locale) {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_LOCALE,
locale,
translations
translations,
});
}
).catch(
......@@ -424,7 +424,7 @@ export function emitRemoteUserTypingEvent(channelId, userId, postParentId) {
type: Constants.ActionTypes.USER_TYPING,
channelId,
userId,
postParentId
postParentId,
});
}
......@@ -466,7 +466,7 @@ export function toggleSideBarRightMenuAction() {
export function emitBrowserFocus(focus) {
AppDispatcher.handleViewAction({
type: ActionTypes.BROWSER_CHANGE_FOCUS,
focus
focus,
});
}
......@@ -521,7 +521,7 @@ export async function redirectUserToDefaultTeam() {
export function postListScrollChange(forceScrollToBottom = false) {
AppDispatcher.handleViewAction({
type: EventTypes.POST_LIST_SCROLL_CHANGE,
value: forceScrollToBottom
value: forceScrollToBottom,
});
}
......@@ -529,7 +529,7 @@ export function emitPopoverMentionKeyClick(isRHS, mentionKey) {
AppDispatcher.handleViewAction({
type: ActionTypes.POPOVER_MENTION_KEY_CLICK,
isRHS,
mentionKey
mentionKey,
});
}
......
......@@ -215,7 +215,7 @@ export function getSuggestedCommands(command, suggestionId, component) {
matches.push({
suggestion: s,
hint,
description: cmd.auto_complete_desc
description: cmd.auto_complete_desc,
});
}
}
......@@ -232,7 +232,7 @@ export function getSuggestedCommands(command, suggestionId, component) {
matchedPretext: command,
terms,
items: matches,
component
component,
});
}
).catch(
......
......@@ -58,7 +58,7 @@ export function sendDesktopNotification(post, msgProps) {
title = msgProps.channel_display_name;
channel = {
name: msgProps.channel_name,
type: msgProps.channel_type
type: msgProps.channel_type,
};
} else if (channel.type === Constants.DM_CHANNEL) {
title = Utils.localizeMessage('notification.dm', 'Direct Message');
......
......@@ -67,7 +67,7 @@ function dispatchPostActions(post, websocketMessageProps) {
dispatch({
type: ActionTypes.INCREASE_POST_VISIBILITY,
data: post.channel_id,
amount: 1
amount: 1,
});
}
......@@ -77,17 +77,17 @@ function dispatchPostActions(post, websocketMessageProps) {
data: {
order: [],
posts: {
[post.id]: post
}
[post.id]: post,
},
},
channelId: post.channel_id
channelId: post.channel_id,
});
// Still needed to update unreads
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_POST,
post,
websocketMessageProps
websocketMessageProps,
});
sendDesktopNotification(post, websocketMessageProps);
......@@ -156,7 +156,7 @@ export async function updatePost(post, success) {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_ERROR,
err: {id: err.server_error_id, ...err},
method: 'editPost'
method: 'editPost',
});
}
}
......@@ -164,7 +164,7 @@ export async function updatePost(post, success) {
export function emitEmojiPosted(emoji) {
AppDispatcher.handleServerAction({
type: ActionTypes.EMOJI_POSTED,
alias: emoji
alias: emoji,
});
}
......@@ -182,19 +182,19 @@ export async function deletePost(channelId, post, success) {
dispatch({
type: ActionTypes.SELECT_POST,
postId: '',
channelId: ''
channelId: '',
});
}
dispatch({
type: PostTypes.REMOVE_POST,
data: post
data: post,
});
// Needed for search store
AppDispatcher.handleViewAction({
type: Constants.ActionTypes.REMOVE_POST,
post
post,
});
const {focusedPostId} = getState().views.channel;
......@@ -227,13 +227,13 @@ export function increasePostVisibility(channelId, focusedPostId) {
{
type: ActionTypes.LOADING_POSTS,
data: true,
channelId
channelId,
},
{
type: ActionTypes.INCREASE_POST_VISIBILITY,
data: channelId,
amount: POST_INCREASE_AMOUNT
}
amount: POST_INCREASE_AMOUNT,
},
]));
const page = Math.floor(currentPostVisibility / POST_INCREASE_AMOUNT);
......@@ -249,7 +249,7 @@ export function increasePostVisibility(channelId, focusedPostId) {
doDispatch({
type: ActionTypes.LOADING_POSTS,
data: false,
channelId
channelId,
});
return posts.order.length >= POST_INCREASE_AMOUNT;
......@@ -267,7 +267,7 @@ export function pinPost(postId) {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_POST_PINNED,
postId
postId,
});
};
}
......@@ -278,7 +278,7 @@ export function unpinPost(postId) {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_POST_UNPINNED,
postId
postId,
});
};
}
......@@ -311,7 +311,7 @@ export function setEditingPost(postId = '', commentsCount = 0, refocusId = '', t
if (canEditNow) {
doDispatch({
type: ActionTypes.SHOW_EDIT_POST_MODAL,
data: {postId, commentsCount, refocusId, title}
data: {postId, commentsCount, refocusId, title},
}, doGetState);
}
......@@ -321,6 +321,6 @@ export function setEditingPost(postId = '', commentsCount = 0, refocusId = '', t
export function hideEditPostModal() {
return {
type: ActionTypes.HIDE_EDIT_POST_MODAL
type: ActionTypes.HIDE_EDIT_POST_MODAL,
};
}
......@@ -10,7 +10,7 @@ export function setItem(name, value) {
const prefix = getPrefix(state);
dispatch({
type: StorageTypes.SET_ITEM,
data: {prefix, name, value}
data: {prefix, name, value},
}, getState);
return {data: true};
};
......@@ -22,7 +22,7 @@ export function removeItem(name) {
const prefix = getPrefix(state);
dispatch({
type: StorageTypes.REMOVE_ITEM,
data: {prefix, name}
data: {prefix, name},
}, getState);
return {data: true};
};
......@@ -32,7 +32,7 @@ export function setGlobalItem(name, value) {
return async (dispatch, getState) => {
dispatch({
type: StorageTypes.SET_GLOBAL_ITEM,
data: {name, value}
data: {name, value},
}, getState);
return {data: true};
};
......@@ -42,7 +42,7 @@ export function removeGlobalItem(name) {
return async (dispatch, getState) => {
dispatch({
type: StorageTypes.REMOVE_GLOBAL_ITEM,
data: {name}
data: {name},
}, getState);
return {data: true};
};
......@@ -52,7 +52,7 @@ export function clear(options) {
return async (dispatch, getState) => {
dispatch({
type: StorageTypes.CLEAR,
data: options
data: options,
}, getState);
return {data: true};
};
......@@ -62,7 +62,7 @@ export function actionOnGlobalItemsWithPrefix(prefix, action) {
return async (dispatch, getState) => {
dispatch({
type: StorageTypes.ACTION_ON_GLOBAL_ITEMS_WITH_PREFIX,
data: {prefix, action}
data: {prefix, action},
}, getState);
return {data: true};
};
......@@ -74,7 +74,7 @@ export function actionOnItemsWithPrefix(prefix, action) {
const globalPrefix = getPrefix(state);
dispatch({
type: StorageTypes.ACTION_ON_ITEMS_WITH_PREFIX,
data: {globalPrefix, prefix, action}
data: {globalPrefix, prefix, action},