From 6b9a2909dff889cc74bc73a3bee4388f5e5d77f8 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 28 Sep 2017 11:21:06 +0100 Subject: [PATCH] Add rule to enforce spacing in curly brackets in JSX children This required an updated in version of eslint-plugin-react to 7.4.0. --- .eslintrc.js | 2 +- jenkins.sh | 4 +- package.json | 3 +- src/SlashCommands.js | 4 +- .../views/dialogs/ExportE2eKeysDialog.js | 8 +- .../views/dialogs/ImportE2eKeysDialog.js | 10 +- src/autocomplete/CommandProvider.js | 4 +- src/autocomplete/RoomProvider.js | 2 +- src/components/structures/GroupView.js | 146 +++++++------- src/components/structures/MatrixChat.js | 4 +- src/components/structures/MyGroups.js | 26 +-- src/components/structures/UserSettings.js | 184 +++++++++--------- .../views/dialogs/AddressPickerDialog.js | 20 +- .../views/dialogs/ConfirmRedactDialog.js | 10 +- .../views/dialogs/ConfirmUserActionDialog.js | 14 +- .../views/dialogs/CreateGroupDialog.js | 12 +- .../views/dialogs/DeviceVerifyDialog.js | 16 +- src/components/views/dialogs/ErrorDialog.js | 4 +- .../views/dialogs/KeyShareDialog.js | 12 +- .../views/dialogs/QuestionDialog.js | 12 +- .../dialogs/SessionRestoreErrorDialog.js | 18 +- .../views/dialogs/SetEmailDialog.js | 6 +- src/components/views/dialogs/SetMxIdDialog.js | 12 +- .../views/dialogs/TextInputDialog.js | 6 +- .../views/elements/AppPermission.js | 8 +- src/components/views/elements/AppTile.js | 14 +- src/components/views/elements/AppWarning.js | 4 +- src/components/views/elements/Flair.js | 4 +- .../views/elements/ManageIntegsButton.js | 6 +- .../views/elements/MessageSpinner.js | 4 +- src/components/views/elements/Pill.js | 12 +- .../views/elements/TruncatedList.js | 6 +- .../views/groups/GroupInviteTile.js | 8 +- .../views/groups/GroupMemberInfo.js | 14 +- .../views/groups/GroupMemberList.js | 4 +- src/components/views/groups/GroupRoomList.js | 4 +- src/components/views/groups/GroupRoomTile.js | 4 +- src/components/views/login/LoginFooter.js | 2 +- .../views/messages/SenderProfile.js | 6 +- src/components/views/messages/UnknownBody.js | 2 +- src/components/views/rooms/AppsDrawer.js | 6 +- src/components/views/rooms/ForwardMessage.js | 2 +- src/components/views/rooms/RoomHeader.js | 38 ++-- .../views/rooms/SimpleRoomHeader.js | 2 +- src/components/views/voip/CallView.js | 10 +- src/components/views/voip/IncomingCallBox.js | 6 +- src/components/views/voip/VideoView.js | 4 +- 47 files changed, 355 insertions(+), 354 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 425f2d2001..429aa24993 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -44,7 +44,7 @@ module.exports = { // // // https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/docs/rules/jsx-curly-spacing.md - "react/jsx-curly-spacing": ["error", "never"], + "react/jsx-curly-spacing": ["error", {"when": "never", "children": {"when": "always"}}], // Assert spacing before self-closing JSX tags, and no spacing before or // after the closing slash, and no spacing after the opening bracket of diff --git a/jenkins.sh b/jenkins.sh index 0979edfa13..3a2d66739e 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -21,9 +21,7 @@ npm run test -- --no-colors npm run lintall -- -f checkstyle -o eslint.xml || true # re-run the linter, excluding any files known to have errors or warnings. -./node_modules/.bin/eslint --max-warnings 0 \ - --ignore-path .eslintignore.errorfiles \ - src test +npm run lintwithexclusions # delete the old tarball, if it exists rm -f matrix-react-sdk-*.tgz diff --git a/package.json b/package.json index e9b4aa9a53..e185a9027d 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "start": "parallelshell \"npm run build:watch\" \"npm run reskindex:watch\"", "lint": "eslint src/", "lintall": "eslint src/ test/", + "lintwithexclusions": "eslint --max-warnings 0 --ignore-path .eslintignore.errorfiles src test", "clean": "rimraf lib", "prepublish": "npm run clean && npm run build && git rev-parse HEAD > git-revision.txt", "test": "karma start --single-run=true --browsers ChromeHeadless", @@ -99,7 +100,7 @@ "eslint-config-google": "^0.7.1", "eslint-plugin-babel": "^4.0.1", "eslint-plugin-flowtype": "^2.30.0", - "eslint-plugin-react": "^6.9.0", + "eslint-plugin-react": "^7.4.0", "expect": "^1.16.0", "json-loader": "^0.5.3", "karma": "^1.7.0", diff --git a/src/SlashCommands.js b/src/SlashCommands.js index 1302aaa423..82665cc2f3 100644 --- a/src/SlashCommands.js +++ b/src/SlashCommands.js @@ -254,7 +254,7 @@ const commands = { title: _t("Ignored user"), description: (
-

{_t("You are now ignoring %(userId)s", {userId: userId})}

+

{ _t("You are now ignoring %(userId)s", {userId: userId}) }

), hasCancelButton: false, @@ -281,7 +281,7 @@ const commands = { title: _t("Unignored user"), description: (
-

{_t("You are no longer ignoring %(userId)s", {userId: userId})}

+

{ _t("You are no longer ignoring %(userId)s", {userId: userId}) }

), hasCancelButton: false, diff --git a/src/async-components/views/dialogs/ExportE2eKeysDialog.js b/src/async-components/views/dialogs/ExportE2eKeysDialog.js index 8f113353d9..04274442c2 100644 --- a/src/async-components/views/dialogs/ExportE2eKeysDialog.js +++ b/src/async-components/views/dialogs/ExportE2eKeysDialog.js @@ -136,13 +136,13 @@ export default React.createClass({ ) }

- {this.state.errStr} + { this.state.errStr }
@@ -155,7 +155,7 @@ export default React.createClass({
@@ -172,7 +172,7 @@ export default React.createClass({ disabled={disableForm} />
diff --git a/src/async-components/views/dialogs/ImportE2eKeysDialog.js b/src/async-components/views/dialogs/ImportE2eKeysDialog.js index 9eac7f78b2..a01b6580f1 100644 --- a/src/async-components/views/dialogs/ImportE2eKeysDialog.js +++ b/src/async-components/views/dialogs/ImportE2eKeysDialog.js @@ -134,13 +134,13 @@ export default React.createClass({ ) }

- {this.state.errStr} + { this.state.errStr }
@@ -153,14 +153,14 @@ export default React.createClass({
+ disabled={disableForm} />
@@ -170,7 +170,7 @@ export default React.createClass({ disabled={!this.state.enableSubmit || disableForm} />
diff --git a/src/autocomplete/CommandProvider.js b/src/autocomplete/CommandProvider.js index 011ad0a7dc..eda05ef514 100644 --- a/src/autocomplete/CommandProvider.js +++ b/src/autocomplete/CommandProvider.js @@ -129,7 +129,7 @@ export default class CommandProvider extends AutocompleteProvider { component: (), range, }; @@ -150,7 +150,7 @@ export default class CommandProvider extends AutocompleteProvider { renderCompletions(completions: [React.Component]): ?React.Component { return
- {completions} + { completions }
; } } diff --git a/src/autocomplete/RoomProvider.js b/src/autocomplete/RoomProvider.js index 1770089eb2..cc04f54dda 100644 --- a/src/autocomplete/RoomProvider.js +++ b/src/autocomplete/RoomProvider.js @@ -106,7 +106,7 @@ export default class RoomProvider extends AutocompleteProvider { renderCompletions(completions: [React.Component]): ?React.Component { return
- {completions} + { completions }
; } } diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index 297d615d30..5381f9add3 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -106,9 +106,9 @@ const CategoryRoomList = React.createClass({ const TintableSvg = sdk.getComponent("elements.TintableSvg"); const addButton = this.props.editing ? ( - +
- {_t('Add a Room')} + { _t('Add a Room') }
) :
; @@ -117,17 +117,19 @@ const CategoryRoomList = React.createClass({ key={r.room_id} groupId={this.props.groupId} editing={this.props.editing} - summaryInfo={r}/>; + summaryInfo={r} />; }); let catHeader =
; if (this.props.category && this.props.category.profile) { - catHeader =
{this.props.category.profile.name}
; + catHeader =
+ { this.props.category.profile.name } +
; } return
- {catHeader} - {roomNodes} - {addButton} + { catHeader } + { roomNodes } + { addButton }
; }, }); @@ -196,9 +198,9 @@ const FeaturedRoom = React.createClass({ let roomNameNode = null; if (permalink) { - roomNameNode = {roomName}; + roomNameNode = { roomName }; } else { - roomNameNode = {roomName}; + roomNameNode = { roomName }; } const deleteButton = this.props.editing ? @@ -208,13 +210,13 @@ const FeaturedRoom = React.createClass({ width="14" height="14" alt="Delete" - onClick={this.onDeleteClicked}/> + onClick={this.onDeleteClicked} /> :
; return -
{roomNameNode}
- {deleteButton} +
{ roomNameNode }
+ { deleteButton }
; }, }); @@ -278,9 +280,9 @@ const RoleUserList = React.createClass({ const TintableSvg = sdk.getComponent("elements.TintableSvg"); const addButton = this.props.editing ? ( - +
- {_t('Add a User')} + { _t('Add a User') }
) :
; const userNodes = this.props.users.map((u) => { @@ -288,16 +290,16 @@ const RoleUserList = React.createClass({ key={u.user_id} summaryInfo={u} editing={this.props.editing} - groupId={this.props.groupId}/>; + groupId={this.props.groupId} />; }); let roleHeader =
; if (this.props.role && this.props.role.profile) { - roleHeader =
{this.props.role.profile.name}
; + roleHeader =
{ this.props.role.profile.name }
; } return
- {roleHeader} - {userNodes} - {addButton} + { roleHeader } + { userNodes } + { addButton }
; }, }); @@ -349,7 +351,7 @@ const FeaturedUser = React.createClass({ const name = this.props.summaryInfo.displayname || this.props.summaryInfo.user_id; const permalink = 'https://matrix.to/#/' + this.props.summaryInfo.user_id; - const userNameNode = {name}; + const userNameNode = { name }; const httpUrl = MatrixClientPeg.get() .mxcUrlToHttp(this.props.summaryInfo.avatar_url, 64, 64); @@ -360,13 +362,13 @@ const FeaturedUser = React.createClass({ width="14" height="14" alt="Delete" - onClick={this.onDeleteClicked}/> + onClick={this.onDeleteClicked} /> :
; return -
{userNameNode}
- {deleteButton} +
{ userNameNode }
+ { deleteButton }
; }, }); @@ -632,7 +634,7 @@ export default React.createClass({ const defaultCategoryNode = ; + editing={this.state.editing} />; const categoryRoomNodes = Object.keys(categoryRooms).map((catId) => { const cat = summary.rooms_section.categories[catId]; return ; + editing={this.state.editing} />; }); return
- {_t('Featured Rooms:')} + { _t('Featured Rooms:') }
- {defaultCategoryNode} - {categoryRoomNodes} + { defaultCategoryNode } + { categoryRoomNodes }
; }, @@ -673,7 +675,7 @@ export default React.createClass({ const noRoleNode = ; + editing={this.state.editing} />; const roleUserNodes = Object.keys(roleUsers).map((roleId) => { const role = summary.users_section.roles[roleId]; return ; + editing={this.state.editing} />; }); return
- {_t('Featured Users:')} + { _t('Featured Users:') }
- {noRoleNode} - {roleUserNodes} + { noRoleNode } + { roleUserNodes }
; }, @@ -708,18 +710,18 @@ export default React.createClass({ return
- {_t("%(inviter)s has invited you to join this group", {inviter: group.inviter.userId})} + { _t("%(inviter)s has invited you to join this group", {inviter: group.inviter.userId}) }
- {_t("Accept")} + { _t("Accept") } - {_t("Decline")} + { _t("Decline") }
; @@ -740,13 +742,13 @@ export default React.createClass({ publicisedButton = - {_t("Unpublish")} + { _t("Unpublish") } ; } publicisedSection =
- {_t("This group is published on your profile")} + { _t("This group is published on your profile") }
- {publicisedButton} + { publicisedButton }
; } else { @@ -754,13 +756,13 @@ export default React.createClass({ publicisedButton = - {_t("Publish")} + { _t("Publish") } ; } publicisedSection =
- {_t("This group is not published on your profile")} + { _t("This group is not published on your profile") }
- {publicisedButton} + { publicisedButton }
; } @@ -768,17 +770,17 @@ export default React.createClass({ return
- {youAreAMemberText} + { youAreAMemberText }
- {_t("Leave")} + { _t("Leave") }
- {publicisedSection} + { publicisedSection }
; } @@ -818,15 +820,15 @@ export default React.createClass({ avatarNode = (
- +
); @@ -846,13 +848,13 @@ export default React.createClass({ - {_t('Save')} + { _t('Save') } , ); rightButtons.push( {_t("Cancel")}/ + width="18" height="18" alt={_t("Cancel")} /> , ); roomBody =
@@ -860,8 +862,8 @@ export default React.createClass({ onChange={this._onLongDescChange} tabIndex="3" /> - {this._getFeaturedRoomsNode()} - {this._getFeaturedUsersNode()} + { this._getFeaturedRoomsNode() } + { this._getFeaturedUsersNode() }
; } else { const groupAvatarUrl = summary.profile ? summary.profile.avatar_url : null; @@ -872,41 +874,41 @@ export default React.createClass({ />; if (summary.profile && summary.profile.name) { nameNode =
- {summary.profile.name} + { summary.profile.name } - ({this.props.groupId}) + ({ this.props.groupId })
; } else { - nameNode = {this.props.groupId}; + nameNode = { this.props.groupId }; } - shortDescNode = {summary.profile.short_description}; + shortDescNode = { summary.profile.short_description }; let description = null; if (summary.profile && summary.profile.long_description) { description = sanitizedHtmlNode(summary.profile.long_description); } roomBody =
- {this._getMembershipSection()} -
{description}
- {this._getFeaturedRoomsNode()} - {this._getFeaturedUsersNode()} + { this._getMembershipSection() } +
{ description }
+ { this._getFeaturedRoomsNode() } + { this._getFeaturedUsersNode() }
; if (summary.user && summary.user.is_privileged) { rightButtons.push( - + , ); } if (this.props.collapsedRhs) { rightButtons.push( - + , ); } @@ -919,40 +921,40 @@ export default React.createClass({
- {avatarNode} + { avatarNode }
- {nameNode} + { nameNode }
- {shortDescNode} + { shortDescNode }
- {rightButtons} + { rightButtons }
- {roomBody} + { roomBody }
); } else if (this.state.error) { if (this.state.error.httpStatus === 404) { return (
- Group {this.props.groupId} not found + Group { this.props.groupId } not found
); } else { let extraText; if (this.state.error.errcode === 'M_UNRECOGNIZED') { - extraText =
{_t('This Home server does not support groups')}
; + extraText =
{ _t('This Home server does not support groups') }
; } return (
- Failed to load {this.props.groupId} - {extraText} + Failed to load { this.props.groupId } + { extraText }
); } diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 4787d76be1..89303a2e41 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -853,7 +853,7 @@ module.exports = React.createClass({ title: _t("Leave room"), description: ( - {_t("Are you sure you want to leave the room '%(roomName)s'?", {roomName: roomToLeave.name})} + { _t("Are you sure you want to leave the room '%(roomName)s'?", {roomName: roomToLeave.name}) } ), onFinished: (shouldLeave) => { @@ -1450,7 +1450,7 @@ module.exports = React.createClass({ return ( diff --git a/src/components/structures/MyGroups.js b/src/components/structures/MyGroups.js index 624f3c67dd..ab2111ee56 100644 --- a/src/components/structures/MyGroups.js +++ b/src/components/structures/MyGroups.js @@ -39,7 +39,7 @@ const GroupTile = React.createClass({ }, render: function() { - return {this.props.groupId}; + return { this.props.groupId }; }, }); @@ -90,51 +90,51 @@ export default withMatrixClient(React.createClass({ ); }); content =
-
{_t('You are a member of these groups:')}
- {groupNodes} +
{ _t('You are a member of these groups:') }
+ { groupNodes }
; } else if (this.state.error) { content =
- {_t('Error whilst fetching joined groups')} + { _t('Error whilst fetching joined groups') }
; } else { content = ; } return
- +
- {_t('Create a new group')} + { _t('Create a new group') }
- {_t( + { _t( 'Create a group to represent your community! '+ 'Define a set of rooms and your own custom homepage '+ 'to mark out your space in the Matrix universe.', - )} + ) }
- {_t('Join an existing group')} + { _t('Join an existing group') }
- {_tJsx( + { _tJsx( 'To join an existing group you\'ll have to '+ 'know its group identifier; this will look '+ 'something like +example:matrix.org.', /(.*)<\/i>/, - (sub) => {sub}, - )} + (sub) => { sub }, + ) }
- {content} + { content }
; }, diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index d2f27b63e1..f003ca2b6f 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -52,7 +52,7 @@ const gHVersionLabel = function(repo, token='') { } else { url = `https://github.com/${repo}/commit/${token.split('-')[0]}`; } - return {token}; + return { token }; }; // Enumerate some simple 'flip a bit' UI settings (if any). @@ -674,7 +674,7 @@ module.exports = React.createClass({

Referral

- {_t("Refer a friend to Riot:")} {href} + { _t("Refer a friend to Riot:") } { href }
); @@ -693,7 +693,7 @@ module.exports = React.createClass({ _renderLanguageSetting: function() { const LanguageDropdown = sdk.getComponent('views.elements.LanguageDropdown'); return
- + - {_t('Autocomplete Delay (ms):')} + { _t('Autocomplete Delay (ms):') }
@@ -871,13 +871,13 @@ module.exports = React.createClass({ if (setting.fn) setting.fn(e.target.checked); }; - return
- + -
; @@ -887,8 +887,8 @@ module.exports = React.createClass({ const DevicesPanel = sdk.getComponent('settings.DevicesPanel'); return (
-

{_t("Devices")}

- +

{ _t("Devices") }

+
); }, @@ -903,7 +903,7 @@ module.exports = React.createClass({

{ _t("Found a bug?") }

@@ -911,13 +911,13 @@ module.exports = React.createClass({ }, _renderAnalyticsControl: function() { - if (!SdkConfig.get().piwik) return
; + if (!SdkConfig.get().piwik) return
; return

{ _t('Analytics') }

- {_t('Riot collects anonymous analytics to allow us to improve the application.')} - {ANALYTICS_SETTINGS_LABELS.map( this._renderLocalSetting )} + { _t('Riot collects anonymous analytics to allow us to improve the application.') } + { ANALYTICS_SETTINGS_LABELS.map( this._renderLocalSetting ) }
; }, @@ -947,10 +947,10 @@ module.exports = React.createClass({ type="checkbox" id={feature.id} name={feature.id} - defaultChecked={ UserSettingsStore.isFeatureEnabled(feature.id) } - onChange={ onChange } + defaultChecked={UserSettingsStore.isFeatureEnabled(feature.id)} + onChange={onChange} /> - +
); }); @@ -964,7 +964,7 @@ module.exports = React.createClass({

{ _t("Labs") }

{ _t("These are experimental features that may break in unexpected ways") }. { _t("Use with caution") }.

- {features} + { features }
); @@ -997,10 +997,10 @@ module.exports = React.createClass({ const platform = PlatformPeg.get(); if ('canSelfUpdate' in platform && platform.canSelfUpdate() && 'startUpdateCheck' in platform) { return
-

{_t('Updates')}

+

{ _t('Updates') }

- {_t('Check for update')} + { _t('Check for update') }
; @@ -1026,7 +1026,7 @@ module.exports = React.createClass({ reject = ( - {_t("Reject all %(invitedRooms)s invites", {invitedRooms: invitedRooms.length})} + { _t("Reject all %(invitedRooms)s invites", {invitedRooms: invitedRooms.length}) } ); } @@ -1034,7 +1034,7 @@ module.exports = React.createClass({ return

{ _t("Bulk Options") }

- {reject} + { reject }
; }, @@ -1052,7 +1052,7 @@ module.exports = React.createClass({ defaultChecked={settings['auto-launch']} onChange={this._onAutoLaunchChanged} /> - +
; @@ -1064,7 +1064,7 @@ module.exports = React.createClass({ }, _mapWebRtcDevicesToSpans: function(devices) { - return devices.map((device) => {device.label}); + return devices.map((device) => { device.label }); }, _setAudioInput: function(deviceId) { @@ -1100,15 +1100,15 @@ module.exports = React.createClass({ if (this.state.mediaDevices === false) { return (

- {_t('Missing Media Permissions, click here to request.')} + { _t('Missing Media Permissions, click here to request.') }

); } else if (!this.state.mediaDevices) return; const Dropdown = sdk.getComponent('elements.Dropdown'); - let microphoneDropdown =

{_t('No Microphones detected')}

; - let webcamDropdown =

{_t('No Webcams detected')}

; + let microphoneDropdown =

{ _t('No Microphones detected') }

; + let webcamDropdown =

{ _t('No Webcams detected') }

; const defaultOption = { deviceId: '', @@ -1125,12 +1125,12 @@ module.exports = React.createClass({ } microphoneDropdown =
-

{_t('Microphone')}

+

{ _t('Microphone') }

- {this._mapWebRtcDevicesToSpans(audioInputs)} + { this._mapWebRtcDevicesToSpans(audioInputs) }
; } @@ -1145,25 +1145,25 @@ module.exports = React.createClass({ } webcamDropdown =
-

{_t('Camera')}

+

{ _t('Camera') }

- {this._mapWebRtcDevicesToSpans(videoInputs)} + { this._mapWebRtcDevicesToSpans(videoInputs) }
; } return
- {microphoneDropdown} - {webcamDropdown} + { microphoneDropdown } + { webcamDropdown }
; }, _renderWebRtcSettings: function() { return
-

{_t('VoIP')}

+

{ _t('VoIP') }

{ WEBRTC_SETTINGS_LABELS.map(this._renderLocalSetting) } { this._renderWebRtcDeviceSettings() } @@ -1229,7 +1229,7 @@ module.exports = React.createClass({ return (
- +
- {
@@ -1250,16 +1250,16 @@ module.exports = React.createClass({ addEmailSection = (
- +
+ placeholder={_t("Add email address")} + blurToCancel={false} + onValueChanged={this._onAddEmailEditFinished} />
{_t("Add")} @@ -1307,8 +1307,8 @@ module.exports = React.createClass({ return (
- {threepidsSection} + { threepidsSection }
-
+
+ showUploadSection={false} className="mx_UserSettings_avatarPicker_img" />
- +
@@ -1357,37 +1357,37 @@ module.exports = React.createClass({
: null } - {accountJsx} + { accountJsx }
- {this._renderReferral()} + { this._renderReferral() } - {notificationArea} + { notificationArea } - {this._renderUserInterfaceSettings()} - {this._renderLabs()} - {this._renderWebRtcSettings()} - {this._renderDevicesPanel()} - {this._renderCryptoInfo()} - {this._renderIgnoredUsers()} - {this._renderBulkOptions()} - {this._renderBugReport()} + { this._renderUserInterfaceSettings() } + { this._renderLabs() } + { this._renderWebRtcSettings() } + { this._renderDevicesPanel() } + { this._renderCryptoInfo() } + { this._renderIgnoredUsers() } + { this._renderBulkOptions() } + { this._renderBugReport() } - {PlatformPeg.get().isElectron() && this._renderElectronSettings()} + { PlatformPeg.get().isElectron() && this._renderElectronSettings() } - {this._renderAnalyticsControl()} + { this._renderAnalyticsControl() }

{ _t("Advanced") }

- { _t("Logged in as:") } {this._me} + { _t("Logged in as:") } { this._me }
- {_t('Access Token:')} + { _t('Access Token:') } + data-spoiler={MatrixClientPeg.get().getAccessToken()}> <{ _t("click to reveal") }>
@@ -1398,23 +1398,23 @@ module.exports = React.createClass({ { _t("Identity Server is") } { MatrixClientPeg.get().getIdentityServerUrl() }
- {_t('matrix-react-sdk version:')} {(REACT_SDK_VERSION !== '') + { _t('matrix-react-sdk version:') } { (REACT_SDK_VERSION !== '') ? gHVersionLabel('matrix-org/matrix-react-sdk', REACT_SDK_VERSION) : REACT_SDK_VERSION - }
- {_t('riot-web version:')} {(this.state.vectorVersion !== undefined) + }
+ { _t('riot-web version:') } { (this.state.vectorVersion !== undefined) ? gHVersionLabel('vector-im/riot-web', this.state.vectorVersion) : 'unknown' - }
- { _t("olm version:") } {olmVersionString}
+ }
+ { _t("olm version:") } { olmVersionString }
- {this._renderCheckUpdate()} + { this._renderCheckUpdate() } - {this._renderClearCache()} + { this._renderClearCache() } - {this._renderDeactivateAccount()} + { this._renderDeactivateAccount() }
diff --git a/src/components/views/dialogs/AddressPickerDialog.js b/src/components/views/dialogs/AddressPickerDialog.js index 4610388afc..6a027ac034 100644 --- a/src/components/views/dialogs/AddressPickerDialog.js +++ b/src/components/views/dialogs/AddressPickerDialog.js @@ -495,7 +495,7 @@ module.exports = React.createClass({ const AddressTile = sdk.getComponent("elements.AddressTile"); for (let i = 0; i < this.state.userList.length; i++) { query.push( - , + , ); } } @@ -529,24 +529,24 @@ module.exports = React.createClass({ validTypesList: validTypeDescriptions.join(", "), }); error =
- {_t("You have entered an invalid address.")} + { _t("You have entered an invalid address.") }
- {tryUsing} + { tryUsing }
; } else if (this.state.searchError) { - error =
{this.state.searchError}
; + error =
{ this.state.searchError }
; } else if ( this.state.query.length > 0 && this.state.queryList.length === 0 && !this.state.busy ) { - error =
{_t("No results")}
; + error =
{ _t("No results") }
; } else { addressSelector = ( {this.addressSelector = ref;}} - addressList={ this.state.queryList } - onSelected={ this.onSelected } - truncateAt={ TRUNCATE_QUERY_LIST } + addressList={this.state.queryList} + onSelected={this.onSelected} + truncateAt={TRUNCATE_QUERY_LIST} /> ); } @@ -554,7 +554,7 @@ module.exports = React.createClass({ return (
- {this.props.title} + { this.props.title }
@@ -570,7 +570,7 @@ module.exports = React.createClass({
diff --git a/src/components/views/dialogs/ConfirmRedactDialog.js b/src/components/views/dialogs/ConfirmRedactDialog.js index 7922b7b289..7b5a9f776b 100644 --- a/src/components/views/dialogs/ConfirmRedactDialog.js +++ b/src/components/views/dialogs/ConfirmRedactDialog.js @@ -52,20 +52,20 @@ export default React.createClass({ return (
- {_t("Are you sure you wish to remove (delete) this event? " + - "Note that if you delete a room name or topic change, it could undo the change.")} + { _t("Are you sure you wish to remove (delete) this event? " + + "Note that if you delete a room name or topic change, it could undo the change.") }
diff --git a/src/components/views/dialogs/ConfirmUserActionDialog.js b/src/components/views/dialogs/ConfirmUserActionDialog.js index 11fba1a322..9091d8975e 100644 --- a/src/components/views/dialogs/ConfirmUserActionDialog.js +++ b/src/components/views/dialogs/ConfirmUserActionDialog.js @@ -88,7 +88,7 @@ export default React.createClass({
@@ -112,22 +112,22 @@ export default React.createClass({ return (
- {avatar} + { avatar }
-
{name}
-
{userId}
+
{ name }
+
{ userId }
- {reasonBox} + { reasonBox }
diff --git a/src/components/views/dialogs/KeyShareDialog.js b/src/components/views/dialogs/KeyShareDialog.js index aed8e6a5af..bc84d52021 100644 --- a/src/components/views/dialogs/KeyShareDialog.js +++ b/src/components/views/dialogs/KeyShareDialog.js @@ -126,17 +126,17 @@ export default React.createClass({ return (
-

{text}

+

{ text }

@@ -154,7 +154,7 @@ export default React.createClass({ } else { content = (
-

{_t('Loading device info...')}

+

{ _t('Loading device info...') }

); @@ -165,7 +165,7 @@ export default React.createClass({ onFinished={this.props.onFinished} title={_t('Encryption key request')} > - {content} + { content } ); }, diff --git a/src/components/views/dialogs/QuestionDialog.js b/src/components/views/dialogs/QuestionDialog.js index 22e68e3ac3..339b284e2f 100644 --- a/src/components/views/dialogs/QuestionDialog.js +++ b/src/components/views/dialogs/QuestionDialog.js @@ -55,7 +55,7 @@ export default React.createClass({ const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); const cancelButton = this.props.hasCancelButton ? ( ) : null; const buttonClasses = classnames({ @@ -64,18 +64,18 @@ export default React.createClass({ }); return (
- {this.props.description} + { this.props.description }
- {this.props.extraButtons} - {cancelButton} + { this.props.extraButtons } + { cancelButton }
); diff --git a/src/components/views/dialogs/SessionRestoreErrorDialog.js b/src/components/views/dialogs/SessionRestoreErrorDialog.js index 010072e8c6..f404bdd975 100644 --- a/src/components/views/dialogs/SessionRestoreErrorDialog.js +++ b/src/components/views/dialogs/SessionRestoreErrorDialog.js @@ -45,10 +45,10 @@ export default React.createClass({ if (SdkConfig.get().bug_report_endpoint_url) { bugreport = (

- {_tJsx( + { _tJsx( "Otherwise, click here to send a bug report.", - /(.*?)<\/a>/, (sub) => {sub}, - )} + /(.*?)<\/a>/, (sub) => { sub }, + ) }

); } @@ -57,19 +57,19 @@ export default React.createClass({
-

{_t("We encountered an error trying to restore your previous session. If " + +

{ _t("We encountered an error trying to restore your previous session. If " + "you continue, you will need to log in again, and encrypted chat " + - "history will be unreadable.")}

+ "history will be unreadable.") }

-

{_t("If you have previously used a more recent version of Riot, your session " + +

{ _t("If you have previously used a more recent version of Riot, your session " + "may be incompatible with this version. Close this window and return " + - "to the more recent version.")}

+ "to the more recent version.") }

- {bugreport} + { bugreport }
diff --git a/src/components/views/dialogs/SetEmailDialog.js b/src/components/views/dialogs/SetEmailDialog.js index ed5cef2f67..2dd996953d 100644 --- a/src/components/views/dialogs/SetEmailDialog.js +++ b/src/components/views/dialogs/SetEmailDialog.js @@ -130,10 +130,10 @@ export default React.createClass({ const emailInput = this.state.emailBusy ? : ; + blurToCancel={false} + onValueChanged={this.onEmailAddressChanged} />; return ( ; + usernameBusyIndicator = ; } else { const usernameAvailable = this.state.username && this.state.usernameCheckSupport && !this.state.usernameError; @@ -275,17 +275,17 @@ export default React.createClass({ /(.*?)<\/a>/, ], [ - (sub) => {this.props.homeserverUrl}, - (sub) => {sub}, + (sub) => { this.props.homeserverUrl }, + (sub) => { sub }, ], - )} + ) }

{ _tJsx( 'If you already have a Matrix account you can log in instead.', /(.*?)<\/a>/, - [(sub) => {sub}], - )} + [(sub) => { sub }], + ) }

{ auth } { authErrorIndicator } diff --git a/src/components/views/dialogs/TextInputDialog.js b/src/components/views/dialogs/TextInputDialog.js index 673be42030..c924da7745 100644 --- a/src/components/views/dialogs/TextInputDialog.js +++ b/src/components/views/dialogs/TextInputDialog.js @@ -65,10 +65,10 @@ export default React.createClass({ >
- +
- +
@@ -76,7 +76,7 @@ export default React.createClass({ { _t("Cancel") }
diff --git a/src/components/views/elements/AppPermission.js b/src/components/views/elements/AppPermission.js index 3dc7e86d75..f1117fd5aa 100644 --- a/src/components/views/elements/AppPermission.js +++ b/src/components/views/elements/AppPermission.js @@ -50,16 +50,16 @@ export default class AppPermission extends React.Component { let e2eWarningText; if (this.props.isRoomEncrypted) { e2eWarningText = - {_t('NOTE: Apps are not end-to-end encrypted')}; + { _t('NOTE: Apps are not end-to-end encrypted') }; } return (
- {_t('Warning!')}/ + {_t('Warning!')}
- {_t('Do you want to load widget from URL:')} {this.state.curlBase} - {e2eWarningText} + { _t('Do you want to load widget from URL:') } { this.state.curlBase } + { e2eWarningText }
- +
); } else if (this.state.hasPermissionToLoad == true) { @@ -312,19 +312,19 @@ export default React.createClass({ return (
- {this.formatAppTileName()} + { this.formatAppTileName() } - {/* Edit widget */} - {showEditButton && {_t('Edit')}} + /> } - {/* Delete widget */} + { /* Delete widget */ }
- {appTileBody} + { appTileBody }
); }, diff --git a/src/components/views/elements/AppWarning.js b/src/components/views/elements/AppWarning.js index 944f1422e6..f4015ae5b7 100644 --- a/src/components/views/elements/AppWarning.js +++ b/src/components/views/elements/AppWarning.js @@ -6,10 +6,10 @@ const AppWarning = (props) => { return (
- {_t('Warning!')}/ + {_t('Warning!')}
- {props.errorMsg} + { props.errorMsg }
); diff --git a/src/components/views/elements/Flair.js b/src/components/views/elements/Flair.js index 0628c6fc8c..11dbcbc021 100644 --- a/src/components/views/elements/Flair.js +++ b/src/components/views/elements/Flair.js @@ -238,11 +238,11 @@ export default class Flair extends React.Component { return
; } const avatars = this.state.profiles.map((profile, index) => { - return ; + return ; }); return ( - {avatars} + { avatars } ); } diff --git a/src/components/views/elements/ManageIntegsButton.js b/src/components/views/elements/ManageIntegsButton.js index 68f67cfad5..17dbbeee62 100644 --- a/src/components/views/elements/ManageIntegsButton.js +++ b/src/components/views/elements/ManageIntegsButton.js @@ -80,7 +80,7 @@ export default class ManageIntegsButton extends React.Component { }); if (this.state.scalarError && !this.scalarClient.hasCredentials()) { - integrationsWarningTriangle = ; + integrationsWarningTriangle = ; // Popup shown when hovering over integrationsButton_error (via CSS) integrationsErrorPopup = ( @@ -90,8 +90,8 @@ export default class ManageIntegsButton extends React.Component { } integrationsButton = ( - - + + { integrationsWarningTriangle } { integrationsErrorPopup } diff --git a/src/components/views/elements/MessageSpinner.js b/src/components/views/elements/MessageSpinner.js index bc0a326338..500c919d45 100644 --- a/src/components/views/elements/MessageSpinner.js +++ b/src/components/views/elements/MessageSpinner.js @@ -26,8 +26,8 @@ module.exports = React.createClass({ const msg = this.props.msg || "Loading..."; return (
-
{msg}
  - +
{ msg }
  +
); }, diff --git a/src/components/views/elements/Pill.js b/src/components/views/elements/Pill.js index 214abc2329..51ae85ba5a 100644 --- a/src/components/views/elements/Pill.js +++ b/src/components/views/elements/Pill.js @@ -167,7 +167,7 @@ const Pill = React.createClass({ userId = member.userId; linkText = member.rawDisplayName.replace(' (IRC)', ''); // FIXME when groups are done if (this.props.shouldShowPillAvatar) { - avatar = ; + avatar = ; } pillClass = 'mx_UserPill'; href = null; @@ -180,7 +180,7 @@ const Pill = React.createClass({ if (room) { linkText = (room ? getDisplayAliasForRoom(room) : null) || resource; if (this.props.shouldShowPillAvatar) { - avatar = ; + avatar = ; } pillClass = 'mx_RoomPill'; } @@ -195,12 +195,12 @@ const Pill = React.createClass({ if (this.state.pillType) { return this.props.inMessage ? - {avatar} - {linkText} + { avatar } + { linkText } : - {avatar} - {linkText} + { avatar } + { linkText } ; } else { // Deliberately render nothing if the URL isn't recognised diff --git a/src/components/views/elements/TruncatedList.js b/src/components/views/elements/TruncatedList.js index 1801b1c3ab..1a674eef65 100644 --- a/src/components/views/elements/TruncatedList.js +++ b/src/components/views/elements/TruncatedList.js @@ -46,7 +46,7 @@ module.exports = React.createClass({ truncateAt: 2, createOverflowElement: function(overflowCount, totalCount) { return ( -
{_t("And %(count)s more...", {count: overflowCount})}
+
{ _t("And %(count)s more...", {count: overflowCount}) }
); }, }; @@ -93,8 +93,8 @@ module.exports = React.createClass({ return (
- {childNodes} - {overflowNode} + { childNodes } + { overflowNode }
); }, diff --git a/src/components/views/groups/GroupInviteTile.js b/src/components/views/groups/GroupInviteTile.js index b1578888bc..07c0bcf6b9 100644 --- a/src/components/views/groups/GroupInviteTile.js +++ b/src/components/views/groups/GroupInviteTile.js @@ -50,7 +50,7 @@ export default React.createClass({ className="mx_GroupInviteTile_name" dir="auto" > - {this.props.group.name} + { this.props.group.name } ; const badge =
!
; @@ -58,11 +58,11 @@ export default React.createClass({ return (
- {av} + { av }
- {label} - {badge} + { label } + { badge }
); diff --git a/src/components/views/groups/GroupMemberInfo.js b/src/components/views/groups/GroupMemberInfo.js index 499fb43ccb..6f1a370f26 100644 --- a/src/components/views/groups/GroupMemberInfo.js +++ b/src/components/views/groups/GroupMemberInfo.js @@ -128,7 +128,7 @@ module.exports = withMatrixClient(React.createClass({ kickButton = ( - {_t('Remove from group')} + { _t('Remove from group') } ); @@ -143,11 +143,11 @@ module.exports = withMatrixClient(React.createClass({ if (kickButton || adminButton) { adminTools =
-

{_t("Admin Tools")}

+

{ _t("Admin Tools") }

- {kickButton} - {adminButton} + { kickButton } + { adminButton }
; } @@ -173,13 +173,13 @@ module.exports = withMatrixClient(React.createClass({
- +
- {avatar} + { avatar }
- {groupMemberName} + { groupMemberName }
diff --git a/src/components/views/groups/GroupMemberList.js b/src/components/views/groups/GroupMemberList.js index fdaf815fe1..6a257259f9 100644 --- a/src/components/views/groups/GroupMemberList.js +++ b/src/components/views/groups/GroupMemberList.js @@ -135,7 +135,7 @@ export default withMatrixClient(React.createClass({
+ placeholder={_t('Filter group members')} />
); @@ -146,7 +146,7 @@ export default withMatrixClient(React.createClass({ - {this.makeGroupMemberTiles(this.state.searchQuery)} + { this.makeGroupMemberTiles(this.state.searchQuery) }
diff --git a/src/components/views/groups/GroupRoomList.js b/src/components/views/groups/GroupRoomList.js index 0a9dbb4d76..39ff3e4a07 100644 --- a/src/components/views/groups/GroupRoomList.js +++ b/src/components/views/groups/GroupRoomList.js @@ -123,7 +123,7 @@ export default React.createClass({
+ placeholder={_t('Filter group rooms')} />
); @@ -134,7 +134,7 @@ export default React.createClass({ - {this.makeGroupRoomTiles(this.state.searchQuery)} + { this.makeGroupRoomTiles(this.state.searchQuery) }
diff --git a/src/components/views/groups/GroupRoomTile.js b/src/components/views/groups/GroupRoomTile.js index 771e3d9c4f..452f862d16 100644 --- a/src/components/views/groups/GroupRoomTile.js +++ b/src/components/views/groups/GroupRoomTile.js @@ -71,10 +71,10 @@ const GroupRoomTile = React.createClass({ return (
- {av} + { av }
- {name} + { name }
); diff --git a/src/components/views/login/LoginFooter.js b/src/components/views/login/LoginFooter.js index 8bdec71685..392d36e288 100644 --- a/src/components/views/login/LoginFooter.js +++ b/src/components/views/login/LoginFooter.js @@ -25,7 +25,7 @@ module.exports = React.createClass({ render: function() { return ( ); }, diff --git a/src/components/views/messages/SenderProfile.js b/src/components/views/messages/SenderProfile.js index d9ab00e03f..0311239e7a 100644 --- a/src/components/views/messages/SenderProfile.js +++ b/src/components/views/messages/SenderProfile.js @@ -32,9 +32,9 @@ export default function SenderProfile(props) { return (
- {name || ''} - {props.enableFlair ? : null} - {props.aux ? {props.aux} : null} + { name || '' } + { props.enableFlair ? : null } + { props.aux ? { props.aux } : null }
); } diff --git a/src/components/views/messages/UnknownBody.js b/src/components/views/messages/UnknownBody.js index 346d157e24..083d7ac12e 100644 --- a/src/components/views/messages/UnknownBody.js +++ b/src/components/views/messages/UnknownBody.js @@ -31,7 +31,7 @@ module.exports = React.createClass({ const text = this.props.mxEvent.getContent().body; return ( - {text} + { text } ); }, diff --git a/src/components/views/rooms/AppsDrawer.js b/src/components/views/rooms/AppsDrawer.js index 536259ae91..1c9296228d 100644 --- a/src/components/views/rooms/AppsDrawer.js +++ b/src/components/views/rooms/AppsDrawer.js @@ -231,16 +231,16 @@ module.exports = React.createClass({ "mx_AddWidget_button" } title={_t('Add a widget')}> - [+] {_t('Add a widget')} + [+] { _t('Add a widget') }
; } return (
- {apps} + { apps }
- {this._canUserModify() && addWidget} + { this._canUserModify() && addWidget }
); }, diff --git a/src/components/views/rooms/ForwardMessage.js b/src/components/views/rooms/ForwardMessage.js index 3c97128a02..67e55101e8 100644 --- a/src/components/views/rooms/ForwardMessage.js +++ b/src/components/views/rooms/ForwardMessage.js @@ -61,7 +61,7 @@ module.exports = React.createClass({ render: function() { return (
-

{_t('Please select the destination room for this message')}

+

{ _t('Please select the destination room for this message') }

); }, diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index afba4eba1e..42cbb90cd9 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -186,18 +186,18 @@ module.exports = React.createClass({ saveButton = ( - {_t("Save")} + { _t("Save") } ); } if (this.props.onCancelClick) { - cancelButton = ; + cancelButton = ; } if (this.props.saving) { const Spinner = sdk.getComponent("elements.Spinner"); - spinner =
; + spinner =
; } if (canSetRoomName) { @@ -254,7 +254,7 @@ module.exports = React.createClass({ } if (topic) { topicElement = -
{ topic }
; +
{ topic }
; } } @@ -262,16 +262,16 @@ module.exports = React.createClass({ if (canSetRoomAvatar) { roomAvatar = (
-
+
- +
); @@ -286,7 +286,7 @@ module.exports = React.createClass({ if (this.props.onSettingsClick) { settingsButton = - + ; } @@ -301,24 +301,24 @@ module.exports = React.createClass({ let forgetButton; if (this.props.onForgetClick) { forgetButton = - - + + ; } let searchButton; if (this.props.onSearchClick && this.props.inRoom) { searchButton = - - + + ; } let rightPanelButtons; if (this.props.collapsedRhs) { rightPanelButtons = - - + + ; } @@ -342,7 +342,7 @@ module.exports = React.createClass({ } return ( -
+
@@ -353,10 +353,10 @@ module.exports = React.createClass({ { topicElement }
- {spinner} - {saveButton} - {cancelButton} - {rightRow} + { spinner } + { saveButton } + { cancelButton } + { rightRow }
); diff --git a/src/components/views/rooms/SimpleRoomHeader.js b/src/components/views/rooms/SimpleRoomHeader.js index 8c06d71b6f..c47d219624 100644 --- a/src/components/views/rooms/SimpleRoomHeader.js +++ b/src/components/views/rooms/SimpleRoomHeader.js @@ -26,7 +26,7 @@ export function CancelButton(props) { return ( {_t("Cancel")}/ + width="18" height="18" alt={_t("Cancel")} /> ); } diff --git a/src/components/views/voip/CallView.js b/src/components/views/voip/CallView.js index e669f7e0a6..37d111be93 100644 --- a/src/components/views/voip/CallView.js +++ b/src/components/views/voip/CallView.js @@ -129,17 +129,17 @@ module.exports = React.createClass({ if (this.state.call && this.state.call.type === "voice" && this.props.showVoice) { const callRoom = MatrixClientPeg.get().getRoom(this.state.call.roomId); voice = ( -
- {_t("Active call (%(roomName)s)", {roomName: callRoom.name})} +
+ { _t("Active call (%(roomName)s)", {roomName: callRoom.name}) }
); } return (
- { voice }
diff --git a/src/components/views/voip/IncomingCallBox.js b/src/components/views/voip/IncomingCallBox.js index c5934b74dc..c12924791a 100644 --- a/src/components/views/voip/IncomingCallBox.js +++ b/src/components/views/voip/IncomingCallBox.js @@ -62,17 +62,17 @@ module.exports = React.createClass({
- {incomingCallText} + { incomingCallText }
- {_t("Decline")} + { _t("Decline") }
- {_t("Accept")} + { _t("Accept") }
diff --git a/src/components/views/voip/VideoView.js b/src/components/views/voip/VideoView.js index 6ebf2078c1..8f062d27ae 100644 --- a/src/components/views/voip/VideoView.js +++ b/src/components/views/voip/VideoView.js @@ -110,13 +110,13 @@ module.exports = React.createClass({ const maxVideoHeight = fullscreenElement ? null : this.props.maxHeight; return ( -
+
- +
);