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

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,