From 1d99abc4a42575905392d9b2a5d73fad9e85626a Mon Sep 17 00:00:00 2001 From: Ritwik Heda Date: Mon, 6 Aug 2018 11:09:32 -0500 Subject: [PATCH] removes need for `eslint-disable-next-line react/jsx-wrap-multilines` and `eslint-diable-line no extra-parens` --- package-lock.json | 4 +-- package.json | 2 +- .../base/dialog/components/Dialog.native.js | 2 +- .../base/media/components/native/Video.js | 2 +- .../components/web/InlineDialogFailure.js | 2 +- .../components/web/MultiSelectAutocomplete.js | 2 +- .../base/react/components/web/SectionList.js | 2 -- .../base/react/components/web/Watermarks.js | 6 ++--- .../toolbox/components/ToolboxItem.native.js | 2 +- .../toolbox/components/ToolboxItem.web.js | 2 -- .../components/ConnectionStatsTable.js | 2 -- .../components/DesktopPickerPane.js | 10 +++---- .../filmstrip/components/native/Filmstrip.js | 6 ++--- .../invite/components/AddPeopleDialog.web.js | 2 +- .../components/Notification.native.js | 1 - .../LiveStream/BroadcastsDropdown.web.js | 27 ++++++++++--------- .../LiveStream/StartLiveStreamDialog.web.js | 10 +++---- .../settings/components/web/MoreTab.js | 20 +++++++------- .../components/web/OverflowMenuItem.js | 2 +- .../welcome/components/WelcomePage.native.js | 2 -- 20 files changed, 48 insertions(+), 60 deletions(-) diff --git a/package-lock.json b/package-lock.json index 548eb48fe..94d5d54d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6449,8 +6449,8 @@ } }, "eslint-config-jitsi": { - "version": "github:jitsi/eslint-config-jitsi#3d193df6476a73f827582e137a67a8612130a455", - "from": "github:jitsi/eslint-config-jitsi#v0.1.0", + "version": "github:jitsi/eslint-config-jitsi#7474f6668515eb5852f1273dc5a50b940a550d3f", + "from": "github:jitsi/eslint-config-jitsi#7474f6668515eb5852f1273dc5a50b940a550d3f", "dev": true }, "eslint-import-resolver-node": { diff --git a/package.json b/package.json index a31a0c2f3..774a7789a 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "clean-css": "3.4.25", "css-loader": "0.28.7", "eslint": "4.12.1", - "eslint-config-jitsi": "github:jitsi/eslint-config-jitsi#v0.1.0", + "eslint-config-jitsi": "github:jitsi/eslint-config-jitsi#7474f6668515eb5852f1273dc5a50b940a550d3f", "eslint-plugin-flowtype": "2.39.1", "eslint-plugin-import": "2.8.0", "eslint-plugin-jsdoc": "3.2.0", diff --git a/react/features/base/dialog/components/Dialog.native.js b/react/features/base/dialog/components/Dialog.native.js index ff702c728..dd668e716 100644 --- a/react/features/base/dialog/components/Dialog.native.js +++ b/react/features/base/dialog/components/Dialog.native.js @@ -113,7 +113,7 @@ class Dialog extends AbstractDialog { [_TAG_KEY]: _SUBMIT_TEXT_TAG_VALUE }; - let el: ?React$Element<*> = ( // eslint-disable-line no-extra-parens + let el: ?React$Element<*> = ( { ? 'contain' : (style && style.objectFit) || 'cover'; const rtcView - = ( // eslint-disable-line no-extra-parens + = ( { const supportString = t('inlineDialogFailure.supportMsg'); const supportLinkElem = supportLink - ? ( // eslint-disable-line no-extra-parens + ? (
{ supportString.padEnd(supportString.length + 1) } diff --git a/react/features/base/react/components/web/MultiSelectAutocomplete.js b/react/features/base/react/components/web/MultiSelectAutocomplete.js index 2370dea8d..254f7b8fc 100644 --- a/react/features/base/react/components/web/MultiSelectAutocomplete.js +++ b/react/features/base/react/components/web/MultiSelectAutocomplete.js @@ -244,7 +244,7 @@ class MultiSelectAutocomplete extends Component { if (!this.state.error) { return null; } - const content = ( // eslint-disable-line no-extra-parens + const content = (
diff --git a/react/features/base/react/components/web/SectionList.js b/react/features/base/react/components/web/SectionList.js index cdef6220e..c34806ce7 100644 --- a/react/features/base/react/components/web/SectionList.js +++ b/react/features/base/react/components/web/SectionList.js @@ -60,7 +60,6 @@ export default class SectionList extends Component { */ if (sections) { return ( - /* eslint-disable no-extra-parens */ { @@ -83,7 +82,6 @@ export default class SectionList extends Component { ) } - /* eslint-enable no-extra-parens */ ); } diff --git a/react/features/base/react/components/web/Watermarks.js b/react/features/base/react/components/web/Watermarks.js index 7467600fb..b2254e187 100644 --- a/react/features/base/react/components/web/Watermarks.js +++ b/react/features/base/react/components/web/Watermarks.js @@ -105,7 +105,7 @@ class Watermarks extends Component<*, *> { let reactElement = null; if (this.state.showBrandWatermark) { - reactElement = ( // eslint-disable-line no-extra-parens + reactElement = (
@@ -114,7 +114,7 @@ class Watermarks extends Component<*, *> { const { brandWatermarkLink } = this.state; if (brandWatermarkLink) { - reactElement = ( // eslint-disable-line no-extra-parens + reactElement = ( @@ -144,7 +144,7 @@ class Watermarks extends Component<*, *> { const { jitsiWatermarkLink } = this.state; if (jitsiWatermarkLink) { - reactElement = ( // eslint-disable-line no-extra-parens + reactElement = ( diff --git a/react/features/base/toolbox/components/ToolboxItem.native.js b/react/features/base/toolbox/components/ToolboxItem.native.js index 63ac012e7..89efc205a 100644 --- a/react/features/base/toolbox/components/ToolboxItem.native.js +++ b/react/features/base/toolbox/components/ToolboxItem.native.js @@ -67,7 +67,7 @@ export default class ToolboxItem extends AbstractToolboxItem { // XXX TouchableHighlight requires 1 child. If there's a need to // show both the icon and the label, then these two need to be // wrapped in a View. - children = ( // eslint-disable-line no-extra-parens + children = ( { children } diff --git a/react/features/base/toolbox/components/ToolboxItem.web.js b/react/features/base/toolbox/components/ToolboxItem.web.js index bfd985e11..ff8bcddfe 100644 --- a/react/features/base/toolbox/components/ToolboxItem.web.js +++ b/react/features/base/toolbox/components/ToolboxItem.web.js @@ -35,7 +35,6 @@ export default class ToolboxItem extends AbstractToolboxItem { }; const elementType = showLabel ? 'li' : 'div'; const useTooltip = this.tooltip && this.tooltip.length > 0; - // eslint-disable-next-line no-extra-parens let children = ( { this._renderIcon() } @@ -47,7 +46,6 @@ export default class ToolboxItem extends AbstractToolboxItem { ); if (useTooltip) { - // eslint-disable-next-line no-extra-parens children = ( @@ -392,7 +391,6 @@ class ConnectionStatsTable extends Component { const { t, transport } = this.props; if (!transport || transport.length === 0) { - // eslint-disable-next-line no-extra-parens const NA = ( diff --git a/react/features/desktop-picker/components/DesktopPickerPane.js b/react/features/desktop-picker/components/DesktopPickerPane.js index c8546a67c..89d3a7829 100644 --- a/react/features/desktop-picker/components/DesktopPickerPane.js +++ b/react/features/desktop-picker/components/DesktopPickerPane.js @@ -61,18 +61,16 @@ class DesktopPickerPane extends Component { const classNames = `desktop-picker-pane default-scrollbar source-type-${type}`; const previews - = sources ? sources.map( - source => - - // eslint-disable-next-line react/jsx-wrap-multilines + = sources + ? sources.map(source => ( ) - : ( // eslint-disable-line no-extra-parens + type = { type } />)) + : (
{ && } { - /* eslint-disable react/jsx-wrap-multilines */ this._sort( this.props._participants, isNarrowAspectRatio_) - .map(p => + .map(p => ( ) + participant = { p } />)) - /* eslint-enable react/jsx-wrap-multilines */ } { !this._separateLocalThumbnail diff --git a/react/features/invite/components/AddPeopleDialog.web.js b/react/features/invite/components/AddPeopleDialog.web.js index b778717fe..697cfde28 100644 --- a/react/features/invite/components/AddPeopleDialog.web.js +++ b/react/features/invite/components/AddPeopleDialog.web.js @@ -477,7 +477,7 @@ class AddPeopleDialog extends Component<*, *> { const supportString = t('inlineDialogFailure.supportMsg'); const supportLink = interfaceConfig.SUPPORT_URL; const supportLinkContent - = ( // eslint-disable-line no-extra-parens + = ( { supportString.padEnd(supportString.length + 1) } diff --git a/react/features/notifications/components/Notification.native.js b/react/features/notifications/components/Notification.native.js index 15b34d487..7008947e9 100644 --- a/react/features/notifications/components/Notification.native.js +++ b/react/features/notifications/components/Notification.native.js @@ -76,7 +76,6 @@ class Notification extends AbstractNotification { pointerEvents = 'box-none' style = { styles.notificationContent }> { - // eslint-disable-next-line no-extra-parens this._getDescription().map((line, index) => ( - // eslint-disable-next-line react/jsx-wrap-multilines - this._onSelect(broadcast.boundStreamID) }> - { broadcast.title } - - ); - const selected = this.props.broadcasts.find( - broadcast => broadcast.boundStreamID === selectedBoundStreamID); - const triggerText = (selected && selected.title) - || t('liveStreaming.choose'); + const dropdownItems + = broadcasts.map(broadcast => ( + this._onSelect(broadcast.boundStreamID) }> + { broadcast.title } + )); + const selected + = this.props.broadcasts.find( + broadcast => broadcast.boundStreamID === selectedBoundStreamID); + const triggerText + = (selected && selected.title) || t('liveStreaming.choose'); return (
diff --git a/react/features/recording/components/LiveStream/StartLiveStreamDialog.web.js b/react/features/recording/components/LiveStream/StartLiveStreamDialog.web.js index 9c3984f7b..2807cf9a2 100644 --- a/react/features/recording/components/LiveStream/StartLiveStreamDialog.web.js +++ b/react/features/recording/components/LiveStream/StartLiveStreamDialog.web.js @@ -237,7 +237,7 @@ class StartLiveStreamDialog switch (this.props._googleAPIState) { case GOOGLE_API_STATES.LOADED: - googleContent = ( // eslint-disable-line no-extra-parens + googleContent = ( @@ -247,7 +247,7 @@ class StartLiveStreamDialog break; case GOOGLE_API_STATES.SIGNED_IN: - googleContent = ( // eslint-disable-line no-extra-parens + googleContent = ( { `${t('liveStreaming.chooseCTA', { email: _googleProfileEmail })} ` } @@ -273,7 +273,7 @@ class StartLiveStreamDialog case GOOGLE_API_STATES.NEEDS_LOADING: default: - googleContent = ( // eslint-disable-line no-extra-parens + googleContent = ( @@ -283,7 +283,7 @@ class StartLiveStreamDialog } if (this.state.errorType !== undefined) { - googleContent = ( // eslint-disable-line no-extra-parens + googleContent = ( diff --git a/react/features/settings/components/web/MoreTab.js b/react/features/settings/components/web/MoreTab.js index f77dd32d6..7e136f4d5 100644 --- a/react/features/settings/components/web/MoreTab.js +++ b/react/features/settings/components/web/MoreTab.js @@ -143,16 +143,16 @@ class MoreTab extends AbstractDialogTab { t } = this.props; - const languageItems = languages.map(language => - // eslint-disable-next-line react/jsx-wrap-multilines - super._onChange({ currentLanguage: language }) }> - { t(`languages:${language}`) } - - ); + const languageItems + = languages.map(language => ( + super._onChange({ currentLanguage: language }) }> + { t(`languages:${language}`) } + )); return (
{ * @returns {ReactElement} */ _renderText() { - const textElement = ( // eslint-disable-line no-extra-parens + const textElement = ( { this.props.text } diff --git a/react/features/welcome/components/WelcomePage.native.js b/react/features/welcome/components/WelcomePage.native.js index 1312fc8cb..700157690 100644 --- a/react/features/welcome/components/WelcomePage.native.js +++ b/react/features/welcome/components/WelcomePage.native.js @@ -230,7 +230,6 @@ class WelcomePage extends AbstractWelcomePage { const { t } = this.props; let children; - /* eslint-disable no-extra-parens */ if (this.state.joining) { // TouchableHighlight is picky about what its children can be, so @@ -251,7 +250,6 @@ class WelcomePage extends AbstractWelcomePage { ); } - /* eslint-enable no-extra-parens */ const buttonDisabled = this._isJoinDisabled();