From a2f526c3c3fe23b5f70a98b09d9dcfb58839dc89 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 23 Sep 2016 12:29:54 -0400 Subject: [PATCH] Updating ESLint (#4085) --- .eslintrc.json | 31 ++++++++++++++---- actions/global_actions.jsx | 2 +- client/client.jsx | 4 +-- components/activity_log_modal.jsx | 2 +- .../admin_console/admin_navbar_dropdown.jsx | 4 +-- components/admin_console/admin_sidebar.jsx | 2 +- components/admin_console/audits.jsx | 2 +- components/admin_console/cluster_settings.jsx | 4 +-- components/admin_console/cluster_table.jsx | 2 +- .../admin_console/compliance_reports.jsx | 4 +-- .../admin_console/email_connection_test.jsx | 4 +-- components/admin_console/ldap_test_button.jsx | 2 +- components/admin_console/recycle_db.jsx | 6 ++-- components/admin_console/reload_config.jsx | 6 ++-- components/admin_console/sync_now_button.jsx | 4 +-- components/admin_console/user_item.jsx | 2 +- components/audit_table.jsx | 2 +- .../backstage/components/backstage_header.jsx | 2 +- .../backstage/components/backstage_list.jsx | 2 +- components/channel_header.jsx | 2 +- components/channel_switch_modal.jsx | 2 +- components/code_preview.jsx | 2 +- .../create_team/components/display_name.jsx | 2 +- components/emoji/components/emoji_list.jsx | 4 +-- .../emoji/components/emoji_list_item.jsx | 2 +- components/file_upload_overlay.jsx | 2 +- components/filtered_channel_list.jsx | 2 +- components/get_link_modal.jsx | 2 +- components/header_footer_template.jsx | 4 +-- .../components/installed_outgoing_webhook.jsx | 2 +- components/invite_member_modal.jsx | 2 +- components/loading_screen.jsx | 6 ++-- components/navbar.jsx | 14 ++++---- components/navbar_dropdown.jsx | 8 ++--- components/permalink_view.jsx | 2 +- .../post_view/components/post_attachment.jsx | 15 ++++----- .../components/post_attachment_list.jsx | 2 +- components/post_view/components/post_body.jsx | 2 +- .../post_body_additional_content.jsx | 2 +- components/post_view/post_view_cache.jsx | 2 +- components/rename_channel_modal.jsx | 2 +- components/rhs_comment.jsx | 2 +- components/rhs_header_post.jsx | 2 +- components/rhs_thread.jsx | 2 +- components/search_bar.jsx | 4 +-- components/search_results_item.jsx | 2 +- components/setting_item_max.jsx | 3 +- components/settings_sidebar.jsx | 4 +-- components/sidebar.jsx | 4 +-- components/sidebar_right.jsx | 6 ++-- components/sidebar_right_menu.jsx | 32 +++++++++---------- .../suggestion/channel_mention_provider.jsx | 2 +- .../suggestion/search_channel_provider.jsx | 2 +- .../suggestion/search_user_provider.jsx | 2 +- .../suggestion/switch_channel_provider.jsx | 8 ++--- components/team_general_tab.jsx | 5 ++- components/team_import_tab.jsx | 4 +-- components/team_members_dropdown.jsx | 6 ++-- components/textbox.jsx | 3 +- components/tutorial/tutorial_tip.jsx | 2 +- components/user_profile.jsx | 2 +- .../user_settings/custom_theme_chooser.jsx | 18 +++++------ .../desktop_notification_settings.jsx | 2 +- .../user_settings_notifications.jsx | 32 ++++++++----------- .../user_settings/user_settings_security.jsx | 8 ++--- .../user_settings/user_settings_theme.jsx | 2 +- .../webrtc/components/webrtc_sidebar.jsx | 2 +- i18n/i18n.jsx | 2 +- package.json | 4 +-- utils/channel_intro_messages.jsx | 6 ++-- utils/markdown.jsx | 2 +- utils/syntax_hightlighting.jsx | 2 +- utils/text_formatting.jsx | 6 ++-- 73 files changed, 180 insertions(+), 173 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index c5c100e6e3e3..2762483ef964 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -36,6 +36,7 @@ "block-scoped-var": 2, "brace-style": [2, "1tbs", { "allowSingleLine": false }], "camelcase": [2, {"properties": "never"}], + "class-methods-use-this": 1, "comma-dangle": [2, "never"], "comma-spacing": [2, {"before": false, "after": true}], "comma-style": [2, "last"], @@ -48,6 +49,7 @@ "dot-location": [2, "object"], "dot-notation": 2, "eqeqeq": [2, "smart"], + "func-call-spacing": [2, "never"], "func-names": 2, "func-style": [2, "declaration"], "generator-star-spacing": [2, {"before": false, "after": true}], @@ -56,14 +58,16 @@ "id-blacklist": 0, "indent": [2, 4, {"SwitchCase": 0}], "jsx-quotes": [2, "prefer-single"], - "key-spacing": [2, {"beforeColon": false, "afterColon": true}], + "key-spacing": [2, {"beforeColon": false, "afterColon": true, "mode": "strict"}], "keyword-spacing": [2, {"before": true, "after": true, "overrides": {}}], + "line-comment-position": 0, "linebreak-style": 2, "lines-around-comment": [2, { "beforeBlockComment": true, "beforeLineComment": true, "allowBlockStart": true, "allowBlockEnd": true }], "max-lines": [1, {"max": 450, "skipBlankLines": true, "skipComments": false}], "max-nested-callbacks": [1, {"max":1}], "max-nested-callbacks": [2, {"max":2}], "max-statements-per-line": [2, {"max": 1}], + "multiline-ternary": [1, "never"], "new-cap": 2, "new-parens": 2, "newline-before-return": 0, @@ -99,6 +103,8 @@ "no-fallthrough": 2, "no-floating-decimal": 2, "no-func-assign": 2, + "no-global-assign": 2, + "no-implicit-coercion": 2, "no-implicit-globals": 0, "no-implied-eval": 2, "no-inner-declarations": 0, @@ -131,12 +137,14 @@ "no-redeclare": 2, "no-return-assign": [2, "always"], "no-script-url": 2, - "no-self-assign": 2, + "no-self-assign": [2, {"props": true}], "no-self-compare": 2, "no-sequences": 2, "no-shadow": [2, {"hoist": "functions"}], "no-shadow-restricted-names": 2, "no-spaced-func": 2, + "no-tabs": 0, + "no-template-curly-in-string": 2, "no-ternary": 0, "no-this-before-super": 2, "no-throw-literal": 2, @@ -149,6 +157,7 @@ "no-unneeded-ternary": [2, {"defaultAssignment": false}], "no-unreachable": 2, "no-unsafe-finally": 2, + "no-unsafe-negation": 2, "no-unused-expressions": 2, "no-unused-vars": [2, {"vars": "all", "args": "after-used"}], "no-use-before-define": [2, "nofunc"], @@ -172,6 +181,7 @@ "padded-blocks": [2, "never"], "prefer-arrow-callback": 2, "prefer-const": 2, + "prefer-numeric-literals": 2, "prefer-reflect": 2, "prefer-rest-params": 2, "prefer-spread": 2, @@ -184,6 +194,7 @@ "react/jsx-closing-bracket-location": [2, { "location": "tag-aligned" }], "react/jsx-curly-spacing": [2, "never"], "react/jsx-equals-spacing": [2, "never"], + "react/jsx-filename-extension": 2, "react/jsx-first-prop-new-line": [2, "multiline"], "react/jsx-handler-names": 0, "react/jsx-indent": [2, 4], @@ -196,11 +207,10 @@ "react/jsx-no-target-blank": 2, "react/jsx-no-undef": 2, "react/jsx-pascal-case": 2, - "react/jsx-filename-extension": 2, "react/jsx-space-before-closing": [2, "never"], "react/jsx-uses-react": 2, "react/jsx-uses-vars": 2, - "react/no-comment-textnodes": 2, + "react/jsx-no-comment-textnodes": 2, "react/no-danger": 0, "react/no-deprecated": 2, "react/no-did-mount-set-state": 2, @@ -219,19 +229,28 @@ "react/require-render-return": 2, "react/self-closing-comp": 2, "react/sort-comp": 0, - "react/wrap-multilines": 2, + "react/jsx-wrap-multilines": 2, + "react/no-find-dom-node": 1, + "react/forbid-component-props": 0, + "react/no-danger-with-children": 2, + "react/no-unused-prop-types": [1, {"skipShapeProps": true}], + "react/style-prop-object": 2, + "react/no-children-prop": 2, + "react/no-unescaped-entities": 2, "require-yield": 2, "rest-spread-spacing": [2, "never"], "semi": [2, "always"], "semi-spacing": [2, {"before": false, "after": true}], "sort-imports": 0, + "sort-keys": 0, "space-before-blocks": [2, "always"], "space-before-function-paren": [2, "never"], "space-in-parens": [2, "never"], "space-infix-ops": 2, "space-unary-ops": [2, { "words": true, "nonwords": false }], + "symbol-description": 2, "template-curly-spacing": [2, "never"], - "valid-typeof": 2, + "valid-typeof": [2, {"requireStringLiterals": false}], "vars-on-top": 0, "wrap-iife": [2, "outside"], "wrap-regex": 2, diff --git a/actions/global_actions.jsx b/actions/global_actions.jsx index 3b38d16b0d26..bc7562d44ef3 100644 --- a/actions/global_actions.jsx +++ b/actions/global_actions.jsx @@ -253,7 +253,7 @@ export function loadMorePostsTop(id, isFocusPost) { export function emitLoadMorePostsFocusedBottomEvent() { const id = PostStore.getFocusedPostId(); const latestPostId = PostStore.getLatestPost(id).id; - AsyncClient.getPostsAfter(latestPostId, 0, Constants.POST_CHUNK_SIZE, !!id); + AsyncClient.getPostsAfter(latestPostId, 0, Constants.POST_CHUNK_SIZE, Boolean(id)); } export function emitUserPostedEvent(post) { diff --git a/client/client.jsx b/client/client.jsx index 4cd9c7c7cf8e..439d41f78b86 100644 --- a/client/client.jsx +++ b/client/client.jsx @@ -749,7 +749,7 @@ export default class Client { updateActive(userId, active, success, error) { var data = {}; data.user_id = userId; - data.active = '' + active; + data.active = String(active); request. post(`${this.getUsersRoute()}/update_active`). @@ -1336,7 +1336,7 @@ export default class Client { set(this.defaultHeaders). type('application/json'). accept('application/json'). - send({channelId, command, suggest: '' + suggest}). + send({channelId, command, suggest: String(suggest)}). end(this.handleResponse.bind(this, 'executeCommand', success, error)); this.track('api', 'api_integrations_used'); diff --git a/components/activity_log_modal.jsx b/components/activity_log_modal.jsx index 7560cf5d91c1..2c093e1d211e 100644 --- a/components/activity_log_modal.jsx +++ b/components/activity_log_modal.jsx @@ -90,7 +90,7 @@ export default class ActivityLogModal extends React.Component { this.setState({moreInfo: newMoreInfo}); } render() { - let activityList = []; + const activityList = []; for (let i = 0; i < this.state.sessions.length; i++) { const currentSession = this.state.sessions[i]; diff --git a/components/admin_console/admin_navbar_dropdown.jsx b/components/admin_console/admin_navbar_dropdown.jsx index 0bac263efcb9..f57635a11c68 100644 --- a/components/admin_console/admin_navbar_dropdown.jsx +++ b/components/admin_console/admin_navbar_dropdown.jsx @@ -77,7 +77,7 @@ export default class AdminNavbarDropdown extends React.Component {
  • + /> ); } @@ -118,7 +118,7 @@ export default class AdminNavbarDropdown extends React.Component {
  • + />
  • + /> diff --git a/components/admin_console/audits.jsx b/components/admin_console/audits.jsx index cb500f29c0e2..5e0e03607b11 100644 --- a/components/admin_console/audits.jsx +++ b/components/admin_console/audits.jsx @@ -86,7 +86,7 @@ export default class Audits extends React.Component { className='btn btn-link pull-right' onClick={this.reload} > - + - + - + - + - + - + - + - + ; + return
    ; } let testMessage = null; if (this.state.fail) { testMessage = (
    - +
    ; + return
    ; } let testMessage = null; if (this.state.fail) { testMessage = (
    - + - + {currentRoles} - +
      {auditInfo.sessionId}; } - let descStyle = {}; + const descStyle = {}; if (auditInfo.desc.toLowerCase().indexOf('fail') !== -1) { descStyle.color = 'red'; } diff --git a/components/backstage/components/backstage_header.jsx b/components/backstage/components/backstage_header.jsx index 37b4be349f48..c2dc187b76f5 100644 --- a/components/backstage/components/backstage_header.jsx +++ b/components/backstage/components/backstage_header.jsx @@ -20,7 +20,7 @@ export default class BackstageHeader extends React.Component { key={'divider' + index} className='backstage-header__divider' > - + ); } diff --git a/components/backstage/components/backstage_list.jsx b/components/backstage/components/backstage_list.jsx index ecb8783b790d..974a552398b6 100644 --- a/components/backstage/components/backstage_list.jsx +++ b/components/backstage/components/backstage_list.jsx @@ -89,7 +89,7 @@ export default class BackstageList extends React.Component {
    - + + />
    diff --git a/components/emoji/components/emoji_list.jsx b/components/emoji/components/emoji_list.jsx index 273fc8a257a9..340fc6afcf1e 100644 --- a/components/emoji/components/emoji_list.jsx +++ b/components/emoji/components/emoji_list.jsx @@ -69,7 +69,7 @@ export default class EmojiList extends React.Component { const filter = this.state.filter.toLowerCase(); const isSystemAdmin = Utils.isSystemAdmin(this.props.user.roles); - let emojis = []; + const emojis = []; if (this.state.loading) { emojis.push( @@ -129,7 +129,7 @@ export default class EmojiList extends React.Component {
    - + - {deleteButton} + {deleteButton} ); diff --git a/components/file_upload_overlay.jsx b/components/file_upload_overlay.jsx index 25fafddf17e1..86697cd62808 100644 --- a/components/file_upload_overlay.jsx +++ b/components/file_upload_overlay.jsx @@ -26,7 +26,7 @@ export default class FileUploadOverlay extends React.Component { src={fileOverlayImage} alt='Files' /> - + { const filter = this.state.filter.toLowerCase(); - return !!((chan.name.toLowerCase().indexOf(filter) !== -1 || chan.display_name.toLowerCase().indexOf(filter) !== -1) && chan.delete_at === 0); + return Boolean((chan.name.toLowerCase().indexOf(filter) !== -1 || chan.display_name.toLowerCase().indexOf(filter) !== -1) && chan.delete_at === 0); }); } diff --git a/components/get_link_modal.jsx b/components/get_link_modal.jsx index 0f41b3b29d60..5363ad217f28 100644 --- a/components/get_link_modal.jsx +++ b/components/get_link_modal.jsx @@ -97,7 +97,7 @@ export default class GetLinkModal extends React.Component { if (this.state.copiedLink) { copyLinkConfirm = (

    - +

    {this.props.children} -
    +
    diff --git a/components/integrations/components/installed_outgoing_webhook.jsx b/components/integrations/components/installed_outgoing_webhook.jsx index 4b478255c84b..664439843085 100644 --- a/components/integrations/components/installed_outgoing_webhook.jsx +++ b/components/integrations/components/installed_outgoing_webhook.jsx @@ -115,7 +115,7 @@ export default class InstalledOutgoingWebhook extends React.Component { ); } - let urls = ( + const urls = (
    - +
    ); diff --git a/components/loading_screen.jsx b/components/loading_screen.jsx index 288eda389449..fe2cd6b11c52 100644 --- a/components/loading_screen.jsx +++ b/components/loading_screen.jsx @@ -31,9 +31,9 @@ export default class LoadingScreen extends React.Component {

    {message}

    -
    -
    -
    +
    +
    +
    ); diff --git a/components/navbar.jsx b/components/navbar.jsx index 1e7711d2cc8a..d55c2723bff2 100644 --- a/components/navbar.jsx +++ b/components/navbar.jsx @@ -446,7 +446,7 @@ export default class Navbar extends React.Component { aria-expanded='true' > {channelTitle} - +
      - - - + + + ); } else { @@ -517,9 +517,9 @@ export default class Navbar extends React.Component { defaultMessage='Toggle sidebar' /> - - - + + + ); diff --git a/components/navbar_dropdown.jsx b/components/navbar_dropdown.jsx index c29bf61c379d..60be47767760 100644 --- a/components/navbar_dropdown.jsx +++ b/components/navbar_dropdown.jsx @@ -278,7 +278,7 @@ export default class NavbarDropdown extends React.Component {
    • + /> ); for (var index in this.state.teamMembers) { @@ -409,15 +409,15 @@ export default class NavbarDropdown extends React.Component { /> -
    • +
    • {integrationsLink} {this.renderCustomEmojiLink()} -
    • +
    • {teamSettings} {manageLink} {sysAdminLink} {teams} -
    • +
    • {helpLink} {reportLink}
    • diff --git a/components/permalink_view.jsx b/components/permalink_view.jsx index 55e250d04add..5cd2d0fff111 100644 --- a/components/permalink_view.jsx +++ b/components/permalink_view.jsx @@ -81,7 +81,7 @@ export default class PermalinkView extends React.Component { id='center_panel.recent' defaultMessage='Click here to jump to recent messages. ' /> - +
    diff --git a/components/post_view/components/post_attachment.jsx b/components/post_view/components/post_attachment.jsx index 4442b735ad2c..57335b94a026 100644 --- a/components/post_view/components/post_attachment.jsx +++ b/components/post_view/components/post_attachment.jsx @@ -87,7 +87,7 @@ class PostAttachment extends React.Component { return ''; } - let fieldTables = []; + const fieldTables = []; let headerCols = []; let bodyCols = []; @@ -104,7 +104,7 @@ class PostAttachment extends React.Component { > - {headerCols} + {headerCols} @@ -134,8 +134,7 @@ class PostAttachment extends React.Component { className='attachment-field' key={'attachment__field-' + i + '__' + nrTables} dangerouslySetInnerHTML={{__html: TextFormatting.formatText(field.value || '')}} - > - + /> ); rowPos += 1; lastWasLong = !(field.short === true); @@ -175,8 +174,7 @@ class PostAttachment extends React.Component {
    -
    + /> ); } @@ -250,8 +248,7 @@ class PostAttachment extends React.Component {
    -
    + /> ); } @@ -307,7 +304,7 @@ class PostAttachment extends React.Component { {fields}
    {thumb} -
    +
    diff --git a/components/post_view/components/post_attachment_list.jsx b/components/post_view/components/post_attachment_list.jsx index 7da9efbeeb46..7e9d7980de12 100644 --- a/components/post_view/components/post_attachment_list.jsx +++ b/components/post_view/components/post_attachment_list.jsx @@ -7,7 +7,7 @@ import React from 'react'; export default class PostAttachmentList extends React.Component { render() { - let content = []; + const content = []; this.props.attachments.forEach((attachment, i) => { content.push( - + ); diff --git a/components/rhs_thread.jsx b/components/rhs_thread.jsx index 73c2fb9dcc83..7d0de85900f5 100644 --- a/components/rhs_thread.jsx +++ b/components/rhs_thread.jsx @@ -247,7 +247,7 @@ export default class RhsThread extends React.Component { if (postsArray == null || selected == null) { return ( -
    +
    ); } diff --git a/components/search_bar.jsx b/components/search_bar.jsx index 970da792592b..dc00095edd8e 100644 --- a/components/search_bar.jsx +++ b/components/search_bar.jsx @@ -148,7 +148,7 @@ export default class SearchBar extends React.Component { render() { var isSearching = null; if (this.state.isSearching) { - isSearching = ; + isSearching = ; } let helpClass = 'search-help-popover'; @@ -162,7 +162,7 @@ export default class SearchBar extends React.Component { className='sidebar__collapse' onClick={this.handleClose} > - +
    {Constants.BOT_NAME}
  • ; } - let profilePic = ( + const profilePic = ( - + /> ); } diff --git a/components/settings_sidebar.jsx b/components/settings_sidebar.jsx index 3ccd372f7083..d537b6d10856 100644 --- a/components/settings_sidebar.jsx +++ b/components/settings_sidebar.jsx @@ -23,8 +23,8 @@ export default class SettingsSidebar extends React.Component { } } render() { - let tabList = this.props.tabs.map((tab) => { - let key = `${tab.name}_li`; + const tabList = this.props.tabs.map((tab) => { + const key = `${tab.name}_li`; let className = ''; if (this.props.activeTab === tab.name) { className = 'active'; diff --git a/components/sidebar.jsx b/components/sidebar.jsx index df1df22a87d5..712d75548315 100644 --- a/components/sidebar.jsx +++ b/components/sidebar.jsx @@ -529,9 +529,9 @@ export default class Sidebar extends React.Component { var icon = null; if (channel.type === 'O') { - icon =
    ; + icon =
    ; } else if (channel.type === 'P') { - icon =
    ; + icon =
    ; } else { // set up status icon for direct message channels (status is null for other channel types) icon = ; diff --git a/components/sidebar_right.jsx b/components/sidebar_right.jsx index 7d9934919402..ffafb94345e2 100644 --- a/components/sidebar_right.jsx +++ b/components/sidebar_right.jsx @@ -37,7 +37,7 @@ export default class SidebarRight extends React.Component { this.state = { searchVisible: SearchStore.getSearchResults() !== null, isMentionSearch: SearchStore.getIsMentionSearch(), - postRightVisible: !!PostStore.getSelectedPost(), + postRightVisible: Boolean(PostStore.getSelectedPost()), expanded: false, fromSearch: false, currentUser: UserStore.getCurrentUser(), @@ -88,7 +88,7 @@ export default class SidebarRight extends React.Component { $('.app__body .inner-wrap').removeClass('move--left').removeClass('move--right'); $('.app__body .sidebar--right').removeClass('move--left'); return ( -
    +
    ); } @@ -118,7 +118,7 @@ export default class SidebarRight extends React.Component { onSelectedChange(fromSearch, fromFlaggedPosts) { this.setState({ - postRightVisible: !!PostStore.getSelectedPost(), + postRightVisible: Boolean(PostStore.getSelectedPost()), fromSearch, fromFlaggedPosts }); diff --git a/components/sidebar_right_menu.jsx b/components/sidebar_right_menu.jsx index a2812526462b..6f6a32a5ea6c 100644 --- a/components/sidebar_right_menu.jsx +++ b/components/sidebar_right_menu.jsx @@ -177,7 +177,7 @@ export default class SidebarRightMenu extends React.Component { href='#' onClick={GlobalActions.showInviteMemberModal} > - + - + - + - + - + - + - + - + - + - + this.setState({showUserSettingsModal: true})} > - + - + -
  • +
  • - +
  • -
  • +
  • {helpLink} {reportLink}
  • @@ -436,7 +436,7 @@ export default class SidebarRightMenu extends React.Component { href='#' onClick={this.handleAboutModal} > - + - {item.name} + {item.name}
  • ); } diff --git a/components/suggestion/search_user_provider.jsx b/components/suggestion/search_user_provider.jsx index e33c206a7510..b5466cf39f29 100644 --- a/components/suggestion/search_user_provider.jsx +++ b/components/suggestion/search_user_provider.jsx @@ -27,7 +27,7 @@ class SearchUserSuggestion extends Suggestion { className='profile-img rounded' src={Client.getUsersRoute() + '/' + item.id + '/image?time=' + item.update_at} /> - {item.username} + {item.username} ); } diff --git a/components/suggestion/switch_channel_provider.jsx b/components/suggestion/switch_channel_provider.jsx index e0c862e7e976..70e95b9b13f6 100644 --- a/components/suggestion/switch_channel_provider.jsx +++ b/components/suggestion/switch_channel_provider.jsx @@ -29,9 +29,9 @@ class SwitchChannelSuggestion extends Suggestion { let icon = null; if (item.type === Constants.OPEN_CHANNEL) { - icon =
    ; + icon =
    ; } else if (item.type === Constants.PRIVATE_CHANNEL) { - icon =
    ; + icon =
    ; } else { icon = ; } @@ -41,8 +41,8 @@ class SwitchChannelSuggestion extends Suggestion { onClick={this.handleClick} className={className} > - {icon} - {displayName} + {icon} + {displayName} ); } diff --git a/components/team_general_tab.jsx b/components/team_general_tab.jsx index 4d1860de363e..0d7acb0ca44f 100644 --- a/components/team_general_tab.jsx +++ b/components/team_general_tab.jsx @@ -354,8 +354,7 @@ class GeneralTab extends React.Component { inputs.push(
    - +
    ); @@ -370,8 +370,8 @@ class CustomThemeChooser extends React.Component { defaultMessage='Sidebar Styles' />
    - - + +
    @@ -388,8 +388,8 @@ class CustomThemeChooser extends React.Component { defaultMessage='Center Channel Styles' />
    - - + +
    @@ -406,8 +406,8 @@ class CustomThemeChooser extends React.Component { defaultMessage='Link and Button Styles' />
    - - + +
    diff --git a/components/user_settings/desktop_notification_settings.jsx b/components/user_settings/desktop_notification_settings.jsx index e5376c7ee9fa..1092120493e6 100644 --- a/components/user_settings/desktop_notification_settings.jsx +++ b/components/user_settings/desktop_notification_settings.jsx @@ -21,7 +21,7 @@ export default class DesktopNotificationSettings extends React.Component { } buildMaximizedSetting() { - let inputs = []; + const inputs = []; let extraInfo = null; const activityRadio = [false, false, false]; diff --git a/components/user_settings/user_settings_notifications.jsx b/components/user_settings/user_settings_notifications.jsx index 05881dcf9b9c..35df53e0e0d4 100644 --- a/components/user_settings/user_settings_notifications.jsx +++ b/components/user_settings/user_settings_notifications.jsx @@ -260,9 +260,8 @@ export default class NotificationsTab extends React.Component { } createPushNotificationSection() { - let handleUpdatePushSection; if (this.props.activeSection === 'push') { - let inputs = []; + const inputs = []; let extraInfo = null; let submit = null; @@ -508,9 +507,9 @@ export default class NotificationsTab extends React.Component { } } - handleUpdatePushSection = function updateDesktopSection() { + const handleUpdatePushSection = () => { this.props.updateSection('push'); - }.bind(this); + }; return ( { this.updateFirstNameKey(e.target.checked); - }.bind(this); + }; inputs.push(
    @@ -561,9 +555,9 @@ export default class NotificationsTab extends React.Component { ); } - handleUpdateUsernameKey = function handleUsernameKeyChange(e) { + const handleUpdateUsernameKey = (e) => { this.updateUsernameKey(e.target.checked); - }.bind(this); + }; inputs.push(
    @@ -585,9 +579,9 @@ export default class NotificationsTab extends React.Component {
    ); - handleUpdateMentionKey = function handleMentionKeyChange(e) { + const handleUpdateMentionKey = (e) => { this.updateMentionKey(e.target.checked); - }.bind(this); + }; inputs.push(
    @@ -609,9 +603,9 @@ export default class NotificationsTab extends React.Component {
    ); - handleUpdateChannelKey = function handleChannelKeyChange(e) { + const handleUpdateChannelKey = (e) => { this.updateChannelKey(e.target.checked); - }.bind(this); + }; inputs.push(
    @@ -728,7 +722,7 @@ export default class NotificationsTab extends React.Component { commentsActive[0] = true; } - let inputs = []; + const inputs = []; inputs.push(
    diff --git a/components/user_settings/user_settings_security.jsx b/components/user_settings/user_settings_security.jsx index 5bc29e0df286..3cff93a0f059 100644 --- a/components/user_settings/user_settings_security.jsx +++ b/components/user_settings/user_settings_security.jsx @@ -971,23 +971,23 @@ export default class SecurityTab extends React.Component {
    {signInSection}
    -

    +
    - + - + - +
    +
    ); } return null; diff --git a/i18n/i18n.jsx b/i18n/i18n.jsx index ccfb47ae701b..49babb98474b 100644 --- a/i18n/i18n.jsx +++ b/i18n/i18n.jsx @@ -124,7 +124,7 @@ export function getLanguageInfo(locale) { } export function isLanguageAvailable(locale) { - return !!availableLanguages[locale]; + return Boolean(availableLanguages[locale]); } export function safariFix(callback) { diff --git a/package.json b/package.json index b2012b433d79..8ffe0a8f5546 100644 --- a/package.json +++ b/package.json @@ -47,8 +47,8 @@ "babel-preset-stage-0": "6.5.0", "copy-webpack-plugin": "3.0.1", "css-loader": "0.25.0", - "eslint": "3.0.1", - "eslint-plugin-react": "5.2.2", + "eslint": "3.5.0", + "eslint-plugin-react": "6.3.0", "exports-loader": "0.6.3", "extract-text-webpack-plugin": "1.0.1", "file-loader": "0.9.0", diff --git a/utils/channel_intro_messages.jsx b/utils/channel_intro_messages.jsx index 1d5f29f09deb..899e4e5a427f 100644 --- a/utils/channel_intro_messages.jsx +++ b/utils/channel_intro_messages.jsx @@ -110,7 +110,7 @@ export function createDefaultIntroMessage(channel, centeredIntro) { href='#' onClick={GlobalActions.showGetTeamInviteLinkModal} > - + - + - + +\(\)~@]/).filter((term) => !!term)); + terms.push(...captured[0].split(/[ <>+\(\)~@]/).filter((term) => Boolean(term))); continue; }