Skip to content

Commit

Permalink
MM-22155 Re-enable comma-dangle rule (mattermost#5535)
Browse files Browse the repository at this point in the history
* MM-22155 Re-enable comma-dangle rule

* Re-enable comma-dangle for TS files
  • Loading branch information
hmhealey committed May 21, 2020
1 parent 45541cb commit fca8b79
Show file tree
Hide file tree
Showing 598 changed files with 2,536 additions and 2,538 deletions.
2 changes: 0 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
},
"rules": {
"import/no-unresolved": 2,
"comma-dangle": 0,
"import/order": [
"error",
{
Expand Down Expand Up @@ -70,7 +69,6 @@
"plugin:@typescript-eslint/recommended"
],
"rules": {
"comma-dangle": 0,
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-empty-function": 0,
Expand Down
6 changes: 3 additions & 3 deletions actions/channel_actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const initialState = {
type: '0',
total_msg_count: 0,
team_id: 'team_id',
}
},
},
channelsInTeam: {
'team-id': ['current_channel_id'],
Expand Down Expand Up @@ -280,11 +280,11 @@ describe('Actions.Channel', () => {

const expectedActions = [{
type: 'MOCK_CREATE_GROUP_CHANNEL',
args: [['testuserid1', 'testuserid2']]
args: [['testuserid1', 'testuserid2']],
}];

const fakeData = {
userIds: ['testuserid1', 'testuserid2']
userIds: ['testuserid1', 'testuserid2'],
};

await testStore.dispatch(Actions.openGroupChannelToUserIds(fakeData.userIds));
Expand Down
4 changes: 2 additions & 2 deletions actions/emoji_actions.mock.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const initialState = {
general: {
config: {EnableCustomEmoji: 'true'},
},
}
},
};

jest.mock('selectors/emojis', () => ({
Expand All @@ -23,7 +23,7 @@ jest.mock('selectors/emojis', () => ({
}));

jest.mock('mattermost-redux/actions/emojis', () => ({
getCustomEmojiByName: (...args) => ({type: 'MOCK_GET_CUSTOM_EMOJI_BY_NAME', args})
getCustomEmojiByName: (...args) => ({type: 'MOCK_GET_CUSTOM_EMOJI_BY_NAME', args}),
}));

describe('loadRecentlyUsedCustomEmojis', () => {
Expand Down
2 changes: 1 addition & 1 deletion actions/global_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function emitChannelClickEvent(channel) {
},
() => {
browserHistory.push('/' + this.state.currentTeam.name);
}
},
);
} else {
switchToChannel(channel);
Expand Down
20 changes: 10 additions & 10 deletions actions/invite_actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {sendMembersInvites, sendGuestsInvites} from 'actions/invite_actions.jsx'

jest.mock('actions/team_actions', () => ({
addUsersToTeam: () => ({ // since we are using addUsersToTeamGracefully, this call will always succeed
type: 'MOCK_RECEIVED_ME'
type: 'MOCK_RECEIVED_ME',
}),
}));

Expand Down Expand Up @@ -372,29 +372,29 @@ describe('actions/invite_actions', () => {
{
user: {
id: 'guest1',
roles: 'system_guest'
roles: 'system_guest',
},
reason: {
id: 'invite.guests.new-member',
message: 'This guest has been added to the team and {count, plural, one {channel} other {channels}}.',
values: {
count: 1
}
}
count: 1,
},
},
},
{
user: {
id: 'other-guest',
roles: 'system_guest'
roles: 'system_guest',
},
reason: {
id: 'invite.guests.new-member',
message: 'This guest has been added to the team and {count, plural, one {channel} other {channels}}.',
values: {
count: 1
}
}
}
count: 1,
},
},
},
],
notSent: [
{
Expand Down
2 changes: 1 addition & 1 deletion actions/notification_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const notifyMe = (title, body, channel, teamId, silent) => (dispatch, getState)
silent,
},
},
window.location.origin
window.location.origin,
);
} else {
showNotification({
Expand Down
2 changes: 1 addition & 1 deletion actions/post_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,6 @@ export function resetEmbedVisibility() {
export function emitShortcutReactToLastPostFrom(emittedFrom) {
return {
type: ActionTypes.EMITTED_SHORTCUT_REACT_TO_LAST_POST,
payload: emittedFrom
payload: emittedFrom,
};
}
8 changes: 4 additions & 4 deletions actions/post_actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ describe('Actions.Posts', () => {
data: {
id: 'other_channel_idundefined',
now: POST_CREATED_TIME,
userId: newPost.user_id}
}
userId: newPost.user_id},
},
],
type: 'BATCHING_REDUCER.BATCH',
},
Expand All @@ -211,7 +211,7 @@ describe('Actions.Posts', () => {
expect(data).toEqual(true);

expect(testStore.getActions()).toEqual(
[{data: {commentCount: 0, isRHS: false, postId: 'latest_post_id', refocusId: 'test', title: 'title'}, type: ActionTypes.SHOW_EDIT_POST_MODAL}]
[{data: {commentCount: 0, isRHS: false, postId: 'latest_post_id', refocusId: 'test', title: 'title'}, type: ActionTypes.SHOW_EDIT_POST_MODAL}],
);

const general = {
Expand All @@ -227,7 +227,7 @@ describe('Actions.Posts', () => {
const {data: withLicenseData} = await testStore.dispatch(Actions.setEditingPost('latest_post_id', 0, 'test', 'title'));
expect(withLicenseData).toEqual(true);
expect(testStore.getActions()).toEqual(
[{data: {commentCount: 0, isRHS: false, postId: 'latest_post_id', refocusId: 'test', title: 'title'}, type: ActionTypes.SHOW_EDIT_POST_MODAL}]
[{data: {commentCount: 0, isRHS: false, postId: 'latest_post_id', refocusId: 'test', title: 'title'}, type: ActionTypes.SHOW_EDIT_POST_MODAL}],
);

// should not allow edit for pending post
Expand Down
2 changes: 1 addition & 1 deletion actions/status_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function startPeriodicStatusUpdates() {
() => {
store.dispatch(loadStatusesForChannelAndSidebar());
},
Constants.STATUS_INTERVAL
Constants.STATUS_INTERVAL,
);
}

Expand Down
8 changes: 4 additions & 4 deletions actions/storage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ describe('Actions.Storage', () => {

store.dispatch(Actions.actionOnGlobalItemsWithPrefix(
'prefix',
(key, value) => touchedPairs.push([key, value])
(key, value) => touchedPairs.push([key, value]),
));

assert.deepEqual(
touchedPairs,
[['prefix_test1', 1], ['prefix_test2', 2]]
[['prefix_test1', 1], ['prefix_test2', 2]],
);
});

Expand All @@ -78,12 +78,12 @@ describe('Actions.Storage', () => {
const touchedPairs = [];
store.dispatch(Actions.actionOnItemsWithPrefix(
'prefix',
(key, value) => touchedPairs.push([key, value])
(key, value) => touchedPairs.push([key, value]),
));

assert.deepEqual(
touchedPairs,
[['prefix_test1', 1], ['prefix_test2', 2]]
[['prefix_test1', 1], ['prefix_test2', 2]],
);
});

Expand Down
10 changes: 5 additions & 5 deletions actions/user_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
getCurrentChannelId,
getMyChannels,
getMyChannelMember,
getChannelMembersInChannels
getChannelMembersInChannels,
} from 'mattermost-redux/selectors/entities/channels';
import {getBool} from 'mattermost-redux/selectors/entities/preferences';
import {getCurrentTeamId, getTeamMember} from 'mattermost-redux/selectors/entities/teams';
Expand Down Expand Up @@ -49,7 +49,7 @@ export function loadProfilesAndReloadTeamMembers(page, perPage, teamId, options
if (data) {
await Promise.all([
doDispatch(loadTeamMembersForProfilesList(data, newTeamId, true)),
doDispatch(loadStatusesForProfilesList(data))
doDispatch(loadStatusesForProfilesList(data)),
]);
}

Expand All @@ -64,7 +64,7 @@ export function loadProfilesAndReloadChannelMembers(page, perPage, channelId, so
if (data) {
await Promise.all([
doDispatch(loadChannelMembersForProfilesList(data, newChannelId, true)),
doDispatch(loadStatusesForProfilesList(data))
doDispatch(loadStatusesForProfilesList(data)),
]);
}

Expand Down Expand Up @@ -92,7 +92,7 @@ export function searchProfilesAndTeamMembers(term = '', options = {}) {
if (data) {
await Promise.all([
doDispatch(loadTeamMembersForProfilesList(data, newTeamId)),
doDispatch(loadStatusesForProfilesList(data))
doDispatch(loadStatusesForProfilesList(data)),
]);
}

Expand All @@ -107,7 +107,7 @@ export function searchProfilesAndChannelMembers(term, options = {}) {
if (data) {
await Promise.all([
doDispatch(loadChannelMembersForProfilesList(data, newChannelId)),
doDispatch(loadStatusesForProfilesList(data))
doDispatch(loadStatusesForProfilesList(data)),
]);
}

Expand Down
2 changes: 1 addition & 1 deletion actions/views/channel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ describe('channel view actions', () => {

expect(store.getActions()).toEqual([{
data: true,
type: 'UPDATE_TOAST_STATUS'
type: 'UPDATE_TOAST_STATUS',
}]);
});
});
Expand Down
4 changes: 2 additions & 2 deletions actions/views/channel_sidebar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ describe('setCategoryCollapsed', () => {
currentUserId: 'user1',
profiles: {
user1: {},
}
}
},
},
};

const store = await configureStore(initialState);
Expand Down
14 changes: 7 additions & 7 deletions actions/views/create_comment.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe('rhs view actions', () => {
testStore.dispatch(moveHistoryIndexBack(Posts.MESSAGE_TYPES.COMMENT));

expect(store.getActions()).toEqual(
expect.arrayContaining(testStore.getActions())
expect.arrayContaining(testStore.getActions()),
);
});

Expand All @@ -210,7 +210,7 @@ describe('rhs view actions', () => {
testStore.dispatch(updateCommentDraft(rootId, {message: 'test message', fileInfos: [], uploadsInProgress: []}));

expect(store.getActions()).toEqual(
expect.arrayContaining(testStore.getActions())
expect.arrayContaining(testStore.getActions()),
);
});
});
Expand All @@ -234,7 +234,7 @@ describe('rhs view actions', () => {
expect(PostActions.createPost).toHaveBeenCalled();

expect(lastCall(PostActions.createPost.mock.calls)[0]).toEqual(
expect.objectContaining(post)
expect.objectContaining(post),
);

expect(lastCall(PostActions.createPost.mock.calls)[1]).toBe(draft.fileInfos);
Expand Down Expand Up @@ -327,7 +327,7 @@ describe('rhs view actions', () => {
testStore.dispatch(addMessageIntoHistory(''));

expect(store.getActions()).toEqual(
expect.arrayContaining(testStore.getActions())
expect.arrayContaining(testStore.getActions()),
);
});

Expand All @@ -338,7 +338,7 @@ describe('rhs view actions', () => {
testStore.dispatch(updateCommentDraft(rootId, null));

expect(store.getActions()).toEqual(
expect.arrayContaining(testStore.getActions())
expect.arrayContaining(testStore.getActions()),
);
});

Expand All @@ -365,7 +365,7 @@ describe('rhs view actions', () => {
testStore.dispatch(submitReaction(latestPostId, '+', 'smile'));

expect(store.getActions()).toEqual(
expect.arrayContaining(testStore.getActions())
expect.arrayContaining(testStore.getActions()),
);
});

Expand Down Expand Up @@ -467,7 +467,7 @@ describe('rhs view actions', () => {
0,
'reply_textbox',
'Comment',
true
true,
),
]);
});
Expand Down
2 changes: 1 addition & 1 deletion actions/views/rhs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('rhs view actions', () => {
posts: {
posts: {
[previousSelectedPost.id]: previousSelectedPost,
}
},
},
preferences: {myPreferences: {}},
},
Expand Down
12 changes: 6 additions & 6 deletions actions/websocket_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export function startPeriodicSync() {
reconnect(false);
}
},
SYNC_INTERVAL_MILLISECONDS
SYNC_INTERVAL_MILLISECONDS,
);
}

Expand Down Expand Up @@ -599,7 +599,7 @@ export function handlePostUnreadEvent(msg) {
msgCount: msg.data.msg_count,
mentionCount: msg.data.mention_count,
},
}
},
);
}

Expand Down Expand Up @@ -1160,27 +1160,27 @@ function handleGroupUpdatedEvent(msg) {
function handleGroupAssociatedToTeamEvent(msg) {
store.dispatch({
type: GroupTypes.RECEIVED_GROUP_ASSOCIATED_TO_TEAM,
data: {teamID: msg.broadcast.team_id, groups: [{id: msg.data.group_id}]}
data: {teamID: msg.broadcast.team_id, groups: [{id: msg.data.group_id}]},
});
}

function handleGroupNotAssociatedToTeamEvent(msg) {
store.dispatch({
type: GroupTypes.RECEIVED_GROUP_NOT_ASSOCIATED_TO_TEAM,
data: {teamID: msg.broadcast.team_id, groups: [{id: msg.data.group_id}]}
data: {teamID: msg.broadcast.team_id, groups: [{id: msg.data.group_id}]},
});
}

function handleGroupAssociatedToChannelEvent(msg) {
store.dispatch({
type: GroupTypes.RECEIVED_GROUP_ASSOCIATED_TO_CHANNEL,
data: {channelID: msg.broadcast.channel_id, groups: [{id: msg.data.group_id}]}
data: {channelID: msg.broadcast.channel_id, groups: [{id: msg.data.group_id}]},
});
}

function handleGroupNotAssociatedToChannelEvent(msg) {
store.dispatch({
type: GroupTypes.RECEIVED_GROUP_NOT_ASSOCIATED_TO_CHANNEL,
data: {channelID: msg.broadcast.channel_id, groups: [{id: msg.data.group_id}]}
data: {channelID: msg.broadcast.channel_id, groups: [{id: msg.data.group_id}]},
});
}
Loading

0 comments on commit fca8b79

Please sign in to comment.