From b5c5744bc79d99e75629085ccafedd8f50c41916 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 15 Jul 2016 07:49:57 -0400 Subject: Updating ESLint (#3597) --- webapp/components/admin_console/admin_settings.jsx | 5 ----- webapp/components/create_comment.jsx | 4 ++-- webapp/components/create_post.jsx | 2 +- webapp/components/file_upload.jsx | 3 ++- webapp/components/invite_member_modal.jsx | 10 +++++----- webapp/components/msg_typing.jsx | 2 +- webapp/components/navbar.jsx | 2 +- webapp/components/removed_from_channel_modal.jsx | 2 +- webapp/components/rename_channel_modal.jsx | 2 +- webapp/components/suggestion/suggestion_list.jsx | 2 +- webapp/components/user_settings/user_settings_general.jsx | 13 +++++++++++-- 11 files changed, 26 insertions(+), 21 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/admin_console/admin_settings.jsx b/webapp/components/admin_console/admin_settings.jsx index e11d843a7..e29be33d1 100644 --- a/webapp/components/admin_console/admin_settings.jsx +++ b/webapp/components/admin_console/admin_settings.jsx @@ -106,11 +106,6 @@ export default class AdminSettings extends React.Component { } render() { - let saveClass = 'btn'; - if (this.state.saveNeeded) { - saveClass += 'btn-primary'; - } - return (
{this.renderTitle()} diff --git a/webapp/components/create_comment.jsx b/webapp/components/create_comment.jsx index f7564f396..1f21febf1 100644 --- a/webapp/components/create_comment.jsx +++ b/webapp/components/create_comment.jsx @@ -181,7 +181,7 @@ class CreateComment extends React.Component { } commentMsgKeyPress(e) { - if (this.state.ctrlSend && e.ctrlKey || !this.state.ctrlSend) { + if ((this.state.ctrlSend && e.ctrlKey) || !this.state.ctrlSend) { if (e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) { e.preventDefault(); ReactDOM.findDOMNode(this.refs.textbox).blur(); @@ -313,7 +313,7 @@ class CreateComment extends React.Component { draft.uploadsInProgress = uploadsInProgress; PostStore.storeCommentDraft(this.props.rootId, draft); - this.setState({previews: previews, uploadsInProgress: uploadsInProgress}); + this.setState({previews, uploadsInProgress}); } componentWillReceiveProps(newProps) { diff --git a/webapp/components/create_post.jsx b/webapp/components/create_post.jsx index 508fb36cb..5101c751d 100644 --- a/webapp/components/create_post.jsx +++ b/webapp/components/create_post.jsx @@ -212,7 +212,7 @@ class CreatePost extends React.Component { } postMsgKeyPress(e) { - if (this.state.ctrlSend && e.ctrlKey || !this.state.ctrlSend) { + if ((this.state.ctrlSend && e.ctrlKey) || !this.state.ctrlSend) { if (e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) { e.preventDefault(); ReactDOM.findDOMNode(this.refs.textbox).blur(); diff --git a/webapp/components/file_upload.jsx b/webapp/components/file_upload.jsx index 2f485d4d3..1a3c6eadc 100644 --- a/webapp/components/file_upload.jsx +++ b/webapp/components/file_upload.jsx @@ -282,7 +282,8 @@ class FileUpload extends React.Component { keyUpload(e) { if (Utils.cmdOrCtrlPressed(e) && e.keyCode === Constants.KeyCodes.U) { e.preventDefault(); - if (this.props.postType === 'post' && document.activeElement.id === 'post_textbox' || this.props.postType === 'comment' && document.activeElement.id === 'reply_textbox') { + if ((this.props.postType === 'post' && document.activeElement.id === 'post_textbox') || + (this.props.postType === 'comment' && document.activeElement.id === 'reply_textbox')) { $(this.refs.fileInput).focus().trigger('click'); } } diff --git a/webapp/components/invite_member_modal.jsx b/webapp/components/invite_member_modal.jsx index 265a421b6..68a7b7b15 100644 --- a/webapp/components/invite_member_modal.jsx +++ b/webapp/components/invite_member_modal.jsx @@ -131,7 +131,7 @@ class InviteMemberModal extends React.Component { invites.push(invite); } - this.setState({emailErrors: emailErrors, firstNameErrors: firstNameErrors, lastNameErrors: lastNameErrors}); + this.setState({emailErrors, firstNameErrors, lastNameErrors}); if (!valid || invites.length === 0) { return; @@ -151,7 +151,7 @@ class InviteMemberModal extends React.Component { (err) => { if (err.id === 'api.team.invite_members.already.app_error') { emailErrors[err.detailed_error] = err.message; - this.setState({emailErrors: emailErrors}); + this.setState({emailErrors}); } else { this.setState({serverError: err.message}); } @@ -193,7 +193,7 @@ class InviteMemberModal extends React.Component { var count = this.state.idCount + 1; var inviteIds = this.state.inviteIds; inviteIds.push(count); - this.setState({inviteIds: inviteIds, idCount: count}); + this.setState({inviteIds, idCount: count}); } clearFields() { @@ -225,7 +225,7 @@ class InviteMemberModal extends React.Component { if (!inviteIds.length) { inviteIds.push(++count); } - this.setState({inviteIds: inviteIds, idCount: count}); + this.setState({inviteIds, idCount: count}); } showGetTeamInviteLinkModal() { @@ -435,7 +435,7 @@ class InviteMemberModal extends React.Component { id='invite_member.teamInviteLink' defaultMessage='You can also invite people using the {link}.' values={{ - link: (link) + link }} />

diff --git a/webapp/components/msg_typing.jsx b/webapp/components/msg_typing.jsx index 631eea78d..f6a6d12b2 100644 --- a/webapp/components/msg_typing.jsx +++ b/webapp/components/msg_typing.jsx @@ -71,7 +71,7 @@ class MsgTyping extends React.Component { defaultMessage='{users} and {last} are typing...' values={{ users: (users.join(', ')), - last: (last) + last }} /> ); diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx index 44730f4e2..c2d262819 100644 --- a/webapp/components/navbar.jsx +++ b/webapp/components/navbar.jsx @@ -636,7 +636,7 @@ export default class Navbar extends React.Component { defaultMessage='No channel header yet.{newline}{link} to add one.' values={{ newline: (
), - link: (link) + link }} />
diff --git a/webapp/components/removed_from_channel_modal.jsx b/webapp/components/removed_from_channel_modal.jsx index 3164e4e3f..3bdceadf7 100644 --- a/webapp/components/removed_from_channel_modal.jsx +++ b/webapp/components/removed_from_channel_modal.jsx @@ -116,7 +116,7 @@ export default class RemovedFromChannelModal extends React.Component { id='removed_channel.remover' defaultMessage='{remover} removed you from {channel}' values={{ - remover: (remover), + remover, channel: (channelName) }} /> diff --git a/webapp/components/rename_channel_modal.jsx b/webapp/components/rename_channel_modal.jsx index df08bdbc6..4dc84d971 100644 --- a/webapp/components/rename_channel_modal.jsx +++ b/webapp/components/rename_channel_modal.jsx @@ -203,7 +203,7 @@ export default class RenameChannelModal extends React.Component { const displayName = ReactDOM.findDOMNode(this.refs.displayName).value.trim(); const channelName = Utils.cleanUpUrlable(displayName); ReactDOM.findDOMNode(this.refs.channelName).value = channelName; - this.setState({channelName: channelName}); + this.setState({channelName}); } } diff --git a/webapp/components/suggestion/suggestion_list.jsx b/webapp/components/suggestion/suggestion_list.jsx index f1cccf8aa..52b85b2f5 100644 --- a/webapp/components/suggestion/suggestion_list.jsx +++ b/webapp/components/suggestion/suggestion_list.jsx @@ -87,7 +87,7 @@ export default class SuggestionList extends React.Component { content.scrollTop(itemTop - contentTopPadding); } else if (itemBottom + contentTopPadding + contentBottomPadding > contentTop + visibleContentHeight) { // the item has gone off the bottom of the visible space - content.scrollTop(itemBottom - visibleContentHeight + contentTopPadding + contentBottomPadding); + content.scrollTop((itemBottom - visibleContentHeight) + contentTopPadding + contentBottomPadding); } } } diff --git a/webapp/components/user_settings/user_settings_general.jsx b/webapp/components/user_settings/user_settings_general.jsx index a449c7d01..9b0e6a204 100644 --- a/webapp/components/user_settings/user_settings_general.jsx +++ b/webapp/components/user_settings/user_settings_general.jsx @@ -295,8 +295,17 @@ class UserSettingsGeneralTab extends React.Component { setupInitialState(props) { const user = props.user; - return {username: user.username, firstName: user.first_name, lastName: user.last_name, nickname: user.nickname, - email: user.email, confirmEmail: '', picture: null, loadingPicture: false, emailChangeInProgress: false}; + return { + username: user.username, + firstName: user.first_name, + lastName: user.last_name, + nickname: user.nickname, + email: user.email, + confirmEmail: '', + picture: null, + loadingPicture: false, + emailChangeInProgress: false + }; } createEmailSection() { -- cgit v1.2.3-1-g7c22