removes need for `eslint-disable-next-line react/jsx-wrap-multilines` and `eslint-diable-line no extra-parens`

This commit is contained in:
Ritwik Heda 2018-08-06 11:09:32 -05:00 committed by Lyubo Marinov
parent 9aed4df6d2
commit 1d99abc4a4
20 changed files with 48 additions and 60 deletions

4
package-lock.json generated
View File

@ -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": {

View File

@ -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",

View File

@ -113,7 +113,7 @@ class Dialog extends AbstractDialog<Props, State> {
[_TAG_KEY]: _SUBMIT_TEXT_TAG_VALUE
};
let el: ?React$Element<*> = ( // eslint-disable-line no-extra-parens
let el: ?React$Element<*> = (
<Prompt
cancelButtonTextStyle = { cancelButtonTextStyle }
cancelText = { t(cancelTitleKey) }

View File

@ -93,7 +93,7 @@ export default class Video extends Component<*> {
? 'contain'
: (style && style.objectFit) || 'cover';
const rtcView
= ( // eslint-disable-line no-extra-parens
= (
<RTCView
mirror = { this.props.mirror }
objectFit = { objectFit }

View File

@ -41,7 +41,7 @@ class InlineDialogFailure extends Component<*> {
const supportString = t('inlineDialogFailure.supportMsg');
const supportLinkElem
= supportLink
? ( // eslint-disable-line no-extra-parens
? (
<div className = 'inline-dialog-error-text'>
<span>{ supportString.padEnd(supportString.length + 1) }
</span>

View File

@ -244,7 +244,7 @@ class MultiSelectAutocomplete extends Component {
if (!this.state.error) {
return null;
}
const content = ( // eslint-disable-line no-extra-parens
const content = (
<div className = 'autocomplete-error'>
<InlineDialogFailure
onRetry = { this._onRetry } />

View File

@ -60,7 +60,6 @@ export default class SectionList extends Component<Props> {
*/
if (sections) {
return (
/* eslint-disable no-extra-parens */
<Container
className = 'navigate-section-list'>
{
@ -83,7 +82,6 @@ export default class SectionList extends Component<Props> {
)
}
</Container>
/* eslint-enable no-extra-parens */
);
}

View File

@ -105,7 +105,7 @@ class Watermarks extends Component<*, *> {
let reactElement = null;
if (this.state.showBrandWatermark) {
reactElement = ( // eslint-disable-line no-extra-parens
reactElement = (
<div
className = 'watermark rightwatermark'
style = { _RIGHT_WATERMARK_STYLE } />
@ -114,7 +114,7 @@ class Watermarks extends Component<*, *> {
const { brandWatermarkLink } = this.state;
if (brandWatermarkLink) {
reactElement = ( // eslint-disable-line no-extra-parens
reactElement = (
<a
href = { brandWatermarkLink }
target = '_new'>
@ -144,7 +144,7 @@ class Watermarks extends Component<*, *> {
const { jitsiWatermarkLink } = this.state;
if (jitsiWatermarkLink) {
reactElement = ( // eslint-disable-line no-extra-parens
reactElement = (
<a
href = { jitsiWatermarkLink }
target = '_new'>

View File

@ -67,7 +67,7 @@ export default class ToolboxItem extends AbstractToolboxItem<Props> {
// 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 = (
<View style = { style }>
{ children }
<Text style = { styles && styles.labelStyle }>

View File

@ -35,7 +35,6 @@ export default class ToolboxItem extends AbstractToolboxItem<Props> {
};
const elementType = showLabel ? 'li' : 'div';
const useTooltip = this.tooltip && this.tooltip.length > 0;
// eslint-disable-next-line no-extra-parens
let children = (
<Fragment>
{ this._renderIcon() }
@ -47,7 +46,6 @@ export default class ToolboxItem extends AbstractToolboxItem<Props> {
);
if (useTooltip) {
// eslint-disable-next-line no-extra-parens
children = (
<Tooltip
content = { this.tooltip }

View File

@ -280,7 +280,6 @@ class ConnectionStatsTable extends Component {
if (packetLoss) {
const { download, upload } = packetLoss;
// eslint-disable-next-line no-extra-parens
packetLossTableData = (
<td>
<span className = 'connection-info__download'>
@ -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 = (
<tr key = 'address'>
<td>

View File

@ -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 => (
<DesktopSourcePreview
key = { source.id }
onClick = { onClick }
onDoubleClick = { onDoubleClick }
selected = { source.id === selectedSourceId }
source = { source }
type = { type } />)
: ( // eslint-disable-line no-extra-parens
type = { type } />))
: (
<div className = 'desktop-picker-pane-spinner'>
<Spinner
isCompleting = { false }

View File

@ -121,17 +121,15 @@ class Filmstrip extends Component<Props> {
&& <LocalThumbnail />
}
{
/* eslint-disable react/jsx-wrap-multilines */
this._sort(
this.props._participants,
isNarrowAspectRatio_)
.map(p =>
.map(p => (
<Thumbnail
key = { p.id }
participant = { p } />)
participant = { p } />))
/* eslint-enable react/jsx-wrap-multilines */
}
{
!this._separateLocalThumbnail

View File

@ -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
= (
<span>
<span>
{ supportString.padEnd(supportString.length + 1) }

View File

@ -76,7 +76,6 @@ class Notification extends AbstractNotification<Props> {
pointerEvents = 'box-none'
style = { styles.notificationContent }>
{
// eslint-disable-next-line no-extra-parens
this._getDescription().map((line, index) => (
<Text
key = { index }

View File

@ -86,19 +86,20 @@ class BroadcastsDropdown extends PureComponent {
render() {
const { broadcasts, selectedBoundStreamID, t } = this.props;
const dropdownItems = broadcasts.map(broadcast =>
// eslint-disable-next-line react/jsx-wrap-multilines
const dropdownItems
= broadcasts.map(broadcast => (
<DropdownItem
key = { broadcast.boundStreamID }
// eslint-disable-next-line react/jsx-no-bind
onClick = { () => this._onSelect(broadcast.boundStreamID) }>
{ broadcast.title }
</DropdownItem>
);
const selected = this.props.broadcasts.find(
</DropdownItem>));
const selected
= this.props.broadcasts.find(
broadcast => broadcast.boundStreamID === selectedBoundStreamID);
const triggerText = (selected && selected.title)
|| t('liveStreaming.choose');
const triggerText
= (selected && selected.title) || t('liveStreaming.choose');
return (
<div className = 'broadcast-dropdown'>

View File

@ -237,7 +237,7 @@ class StartLiveStreamDialog
switch (this.props._googleAPIState) {
case GOOGLE_API_STATES.LOADED:
googleContent = ( // eslint-disable-line no-extra-parens
googleContent = (
<GoogleSignInButton
onClick = { this._onGoogleSignIn }
text = { t('liveStreaming.signIn') } />
@ -247,7 +247,7 @@ class StartLiveStreamDialog
break;
case GOOGLE_API_STATES.SIGNED_IN:
googleContent = ( // eslint-disable-line no-extra-parens
googleContent = (
<BroadcastsDropdown
broadcasts = { broadcasts }
onBroadcastSelected = { this._onYouTubeBroadcastIDSelected }
@ -259,7 +259,7 @@ class StartLiveStreamDialog
* that also accepts the anchor. This can be done using the Trans
* component of react-i18next but I couldn't get it working...
*/
helpText = ( // eslint-disable-line no-extra-parens
helpText = (
<div>
{ `${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 = (
<Spinner
isCompleting = { false }
size = 'medium' />
@ -283,7 +283,7 @@ class StartLiveStreamDialog
}
if (this.state.errorType !== undefined) {
googleContent = ( // eslint-disable-line no-extra-parens
googleContent = (
<GoogleSignInButton
onClick = { this._onRequestGoogleSignIn }
text = { t('liveStreaming.signIn') } />

View File

@ -143,16 +143,16 @@ class MoreTab extends AbstractDialogTab<Props, State> {
t
} = this.props;
const languageItems = languages.map(language =>
// eslint-disable-next-line react/jsx-wrap-multilines
const languageItems
= languages.map(language => (
<DropdownItem
key = { language }
// eslint-disable-next-line react/jsx-no-bind
onClick = {
() => super._onChange({ currentLanguage: language }) }>
{ t(`languages:${language}`) }
</DropdownItem>
);
</DropdownItem>));
return (
<div

View File

@ -101,7 +101,7 @@ class OverflowMenuItem extends Component<Props> {
* @returns {ReactElement}
*/
_renderText() {
const textElement = ( // eslint-disable-line no-extra-parens
const textElement = (
<span className = 'overflow-menu-item-text'>
{ this.props.text }
</span>

View File

@ -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();