diff --git a/.eslintignore.errorfiles b/.eslintignore.errorfiles
index 8d0821207a..0b4266c0b5 100644
--- a/.eslintignore.errorfiles
+++ b/.eslintignore.errorfiles
@@ -7,11 +7,8 @@ src/component-index.js
src/components/structures/BottomLeftMenu.js
src/components/structures/CompatibilityPage.js
src/components/structures/CreateRoom.js
-src/components/structures/HomePage.js
-src/components/structures/LeftPanel.js
src/components/structures/LoggedInView.js
src/components/structures/login/ForgotPassword.js
-src/components/structures/LoginBox.js
src/components/structures/MessagePanel.js
src/components/structures/NotificationPanel.js
src/components/structures/RoomDirectory.js
@@ -22,22 +19,17 @@ src/components/structures/SearchBox.js
src/components/structures/TimelinePanel.js
src/components/structures/UploadBar.js
src/components/structures/UserSettings.js
-src/components/structures/ViewSource.js
src/components/views/avatars/BaseAvatar.js
src/components/views/avatars/MemberAvatar.js
src/components/views/create_room/RoomAlias.js
-src/components/views/dialogs/ChangelogDialog.js
src/components/views/dialogs/DeactivateAccountDialog.js
src/components/views/dialogs/SetPasswordDialog.js
src/components/views/dialogs/UnknownDeviceDialog.js
src/components/views/directory/NetworkDropdown.js
src/components/views/elements/AddressSelector.js
-src/components/views/elements/DeviceVerifyButtons.js
src/components/views/elements/DirectorySearchBox.js
src/components/views/elements/ImageView.js
-src/components/views/elements/InlineSpinner.js
src/components/views/elements/MemberEventListSummary.js
-src/components/views/elements/Spinner.js
src/components/views/elements/TintableSvg.js
src/components/views/elements/UserSelector.js
src/components/views/globals/MatrixToolbar.js
@@ -90,7 +82,6 @@ src/MatrixClientPeg.js
src/Modal.js
src/notifications/ContentRules.js
src/notifications/PushRuleVectorState.js
-src/notifications/StandardActions.js
src/notifications/VectorPushRulesDefinitions.js
src/Notifier.js
src/PlatformPeg.js
@@ -111,7 +102,6 @@ src/utils/MultiInviter.js
src/utils/Receipt.js
src/VectorConferenceHandler.js
src/Velociraptor.js
-src/VelocityBounce.js
src/WhoIsTyping.js
src/wrappers/withMatrixClient.js
test/components/structures/login/Registration-test.js
diff --git a/src/ComposerHistoryManager.js b/src/ComposerHistoryManager.js
index 0164e6c4cd..ecf773f2e7 100644
--- a/src/ComposerHistoryManager.js
+++ b/src/ComposerHistoryManager.js
@@ -22,7 +22,6 @@ import _clamp from 'lodash/clamp';
type MessageFormat = 'rich' | 'markdown';
class HistoryItem {
-
// We store history items in their native format to ensure history is accurate
// and then convert them if our RTE has subsequently changed format.
value: Value;
diff --git a/src/Entities.js b/src/Entities.js
index 21abd9c473..8be1da0db8 100644
--- a/src/Entities.js
+++ b/src/Entities.js
@@ -78,7 +78,6 @@ class MemberEntity extends Entity {
}
class UserEntity extends Entity {
-
constructor(model, showInviteButton, inviteFn) {
super(model);
this.showInviteButton = Boolean(showInviteButton);
diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js
index b6a2bd0acb..e72c0bfe4b 100644
--- a/src/HtmlUtils.js
+++ b/src/HtmlUtils.js
@@ -64,7 +64,7 @@ export function containsEmoji(str) {
* because we want to include emoji shortnames in title text
*/
function unicodeToImage(str) {
- let replaceWith, unicode, alt, short, fname;
+ let replaceWith; let unicode; let alt; let short; let fname;
const mappedUnicode = emojione.mapUnicodeToShort();
str = str.replace(emojione.regUnicode, function(unicodeChar) {
diff --git a/src/PasswordReset.js b/src/PasswordReset.js
index 71fc4f6b31..df51e4d846 100644
--- a/src/PasswordReset.js
+++ b/src/PasswordReset.js
@@ -25,7 +25,6 @@ import { _t } from './languageHandler';
* API on the homeserver in question with the new password.
*/
class PasswordReset {
-
/**
* Configure the endpoints for password resetting.
* @param {string} homeserverUrl The URL to the HS which has the account to reset.
diff --git a/src/Presence.js b/src/Presence.js
index 9367fe35cd..b1e85e4bc7 100644
--- a/src/Presence.js
+++ b/src/Presence.js
@@ -23,7 +23,6 @@ const UNAVAILABLE_TIME_MS = 3 * 60 * 1000; // 3 mins
const PRESENCE_STATES = ["online", "offline", "unavailable"];
class Presence {
-
/**
* Start listening the user activity to evaluate his presence state.
* Any state change will be sent to the Home Server.
diff --git a/src/Rooms.js b/src/Rooms.js
index e24b8316b3..6f73ea0659 100644
--- a/src/Rooms.js
+++ b/src/Rooms.js
@@ -32,7 +32,6 @@ export function getDisplayAliasForRoom(room) {
* return the other one. Otherwise, return null.
*/
export function getOnlyOtherMember(room, myUserId) {
-
if (room.currentState.getJoinedMemberCount() === 2) {
return room.getJoinedMembers().filter(function(m) {
return m.userId !== myUserId;
@@ -103,7 +102,7 @@ export function guessAndSetDMRoom(room, isDirect) {
let newTarget;
if (isDirect) {
const guessedUserId = guessDMRoomTargetId(
- room, MatrixClientPeg.get().getUserId()
+ room, MatrixClientPeg.get().getUserId(),
);
newTarget = guessedUserId;
} else {
diff --git a/src/ScalarAuthClient.js b/src/ScalarAuthClient.js
index 2038430576..0639e7ceae 100644
--- a/src/ScalarAuthClient.js
+++ b/src/ScalarAuthClient.js
@@ -22,7 +22,6 @@ const SdkConfig = require('./SdkConfig');
const MatrixClientPeg = require('./MatrixClientPeg');
class ScalarAuthClient {
-
constructor() {
this.scalarToken = null;
}
diff --git a/src/SdkConfig.js b/src/SdkConfig.js
index 8df725a913..65982bd6f2 100644
--- a/src/SdkConfig.js
+++ b/src/SdkConfig.js
@@ -24,7 +24,6 @@ const DEFAULTS = {
};
class SdkConfig {
-
static get() {
return global.mxReactSdkConfig || {};
}
diff --git a/src/UserActivity.js b/src/UserActivity.js
index b6fae38ed5..c628ab4186 100644
--- a/src/UserActivity.js
+++ b/src/UserActivity.js
@@ -25,7 +25,6 @@ const CURRENTLY_ACTIVE_THRESHOLD_MS = 2000;
* with the app (but at a much lower frequency than mouse move events)
*/
class UserActivity {
-
/**
* Start listening to user activity
*/
diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js
index 5d2af3715f..b40d0529a2 100644
--- a/src/UserSettingsStore.js
+++ b/src/UserSettingsStore.js
@@ -87,7 +87,7 @@ export default {
device_display_name: address,
lang: navigator.language,
data: data,
- append: true, // We always append for email pushers since we don't want to stop other accounts notifying to the same email address
+ append: true, // We always append for email pushers since we don't want to stop other accounts notifying to the same email address
});
},
};
diff --git a/src/VelocityBounce.js b/src/VelocityBounce.js
index 2141b05325..732550cfcb 100644
--- a/src/VelocityBounce.js
+++ b/src/VelocityBounce.js
@@ -3,8 +3,10 @@ const Velocity = require('velocity-vector');
// courtesy of https://github.com/julianshapiro/velocity/issues/283
// We only use easeOutBounce (easeInBounce is just sort of nonsensical)
function bounce( p ) {
- let pow2,
- bounce = 4;
+ let pow2;
+
+
+let bounce = 4;
while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {
// just sets pow2
diff --git a/src/autocomplete/Autocompleter.js b/src/autocomplete/Autocompleter.js
index 7f91676cc3..e7b89fe576 100644
--- a/src/autocomplete/Autocompleter.js
+++ b/src/autocomplete/Autocompleter.js
@@ -85,7 +85,7 @@ export default class Autocompleter {
provider
.getCompletions(query, selection, force)
.timeout(PROVIDER_COMPLETION_TIMEOUT)
- .reflect()
+ .reflect(),
),
);
diff --git a/src/autocomplete/CommunityProvider.js b/src/autocomplete/CommunityProvider.js
index d164fab46a..b85c09b320 100644
--- a/src/autocomplete/CommunityProvider.js
+++ b/src/autocomplete/CommunityProvider.js
@@ -61,7 +61,7 @@ export default class CommunityProvider extends AutocompleteProvider {
if (command) {
const joinedGroups = cli.getGroups().filter(({myMembership}) => myMembership === 'join');
- const groups = (await Promise.all(joinedGroups.map(async ({groupId}) => {
+ const groups = (await Promise.all(joinedGroups.map(async({groupId}) => {
try {
return FlairStore.getGroupProfileCached(cli, groupId);
} catch (e) { // if FlairStore failed, fall back to just groupId
diff --git a/src/autocomplete/PlainWithPillsSerializer.js b/src/autocomplete/PlainWithPillsSerializer.js
index 59cf1bde3b..09bb3772ac 100644
--- a/src/autocomplete/PlainWithPillsSerializer.js
+++ b/src/autocomplete/PlainWithPillsSerializer.js
@@ -26,7 +26,6 @@ import { Block } from 'slate';
*/
class PlainWithPillsSerializer {
-
/*
* @param {String} options.pillFormat - either 'md', 'plain', 'id'
*/
diff --git a/src/components/structures/BottomLeftMenu.js b/src/components/structures/BottomLeftMenu.js
index d289ca5da1..ed8b8a00b7 100644
--- a/src/components/structures/BottomLeftMenu.js
+++ b/src/components/structures/BottomLeftMenu.js
@@ -33,12 +33,12 @@ module.exports = React.createClass({
},
getInitialState: function() {
- return({
- directoryHover : false,
- roomsHover : false,
+ return ({
+ directoryHover: false,
+ roomsHover: false,
homeHover: false,
- peopleHover : false,
- settingsHover : false,
+ peopleHover: false,
+ settingsHover: false,
});
},
@@ -145,7 +145,7 @@ module.exports = React.createClass({
// Get the label/tooltip to show
getLabel: function(label, show) {
if (show) {
- var RoomTooltip = sdk.getComponent("rooms.RoomTooltip");
+ const RoomTooltip = sdk.getComponent("rooms.RoomTooltip");
return ;
}
},
diff --git a/src/components/structures/CompatibilityPage.js b/src/components/structures/CompatibilityPage.js
index 4cbaab3dfa..3c5005c053 100644
--- a/src/components/structures/CompatibilityPage.js
+++ b/src/components/structures/CompatibilityPage.js
@@ -16,18 +16,18 @@ limitations under the License.
'use strict';
-var React = require('react');
+const React = require('react');
import { _t } from '../../languageHandler';
module.exports = React.createClass({
displayName: 'CompatibilityPage',
propTypes: {
- onAccept: React.PropTypes.func
+ onAccept: React.PropTypes.func,
},
getDefaultProps: function() {
return {
- onAccept: function() {} // NOP
+ onAccept: function() {}, // NOP
};
},
@@ -36,7 +36,6 @@ module.exports = React.createClass({
},
render: function() {
-
return (
@@ -69,5 +68,5 @@ module.exports = React.createClass({
);
- }
+ },
});
diff --git a/src/components/structures/CreateRoom.js b/src/components/structures/CreateRoom.js
index 2bb9adb544..a8aac71479 100644
--- a/src/components/structures/CreateRoom.js
+++ b/src/components/structures/CreateRoom.js
@@ -36,10 +36,10 @@ module.exports = React.createClass({
},
phases: {
- CONFIG: "CONFIG", // We're waiting for user to configure and hit create.
- CREATING: "CREATING", // We're sending the request.
- CREATED: "CREATED", // We successfully created the room.
- ERROR: "ERROR", // There was an error while trying to create room.
+ CONFIG: "CONFIG", // We're waiting for user to configure and hit create.
+ CREATING: "CREATING", // We're sending the request.
+ CREATED: "CREATED", // We successfully created the room.
+ ERROR: "ERROR", // There was an error while trying to create room.
},
getDefaultProps: function() {
diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js
index 5d23194702..2c287c1b60 100644
--- a/src/components/structures/GroupView.js
+++ b/src/components/structures/GroupView.js
@@ -777,7 +777,7 @@ export default React.createClass({
),
button: _t("Leave"),
danger: this.state.isUserPrivileged,
- onFinished: async (confirmed) => {
+ onFinished: async(confirmed) => {
if (!confirmed) return;
this.setState({membershipBusy: true});
diff --git a/src/components/structures/HomePage.js b/src/components/structures/HomePage.js
index 457796f5dc..89053b35c7 100644
--- a/src/components/structures/HomePage.js
+++ b/src/components/structures/HomePage.js
@@ -52,15 +52,14 @@ class HomePage extends React.Component {
if (this.props.teamToken && this.props.teamServerUrl) {
this.setState({
- iframeSrc: `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`
+ iframeSrc: `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`,
});
- }
- else {
+ } else {
// we use request() to inline the homepage into the react component
// so that it can inherit CSS and theming easily rather than mess around
// with iframes and trying to synchronise document.stylesheets.
- let src = this.props.homePageUrl || 'home.html';
+ const src = this.props.homePageUrl || 'home.html';
request(
{ method: "GET", url: src },
@@ -77,7 +76,7 @@ class HomePage extends React.Component {
body = body.replace(/_t\(['"]([\s\S]*?)['"]\)/mg, (match, g1)=>this.translate(g1));
this.setState({ page: body });
- }
+ },
);
}
}
@@ -93,8 +92,7 @@ class HomePage extends React.Component {
);
- }
- else {
+ } else {
const GeminiScrollbarWrapper = sdk.getComponent("elements.GeminiScrollbarWrapper");
return (
@@ -106,4 +104,4 @@ class HomePage extends React.Component {
}
}
-module.exports = HomePage;
\ No newline at end of file
+module.exports = HomePage;
diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js
index 72d640bcac..2d6e7b66d2 100644
--- a/src/components/structures/LeftPanel.js
+++ b/src/components/structures/LeftPanel.js
@@ -28,7 +28,7 @@ import VectorConferenceHandler from '../../VectorConferenceHandler';
import SettingsStore from '../../settings/SettingsStore';
-var LeftPanel = React.createClass({
+const LeftPanel = React.createClass({
displayName: 'LeftPanel',
// NB. If you add props, don't forget to update
@@ -214,11 +214,11 @@ var LeftPanel = React.createClass({
collapsed={this.props.collapsed}
searchFilter={this.state.searchFilter}
ConferenceHandler={VectorConferenceHandler} />
-
+
);
- }
+ },
});
module.exports = LeftPanel;
diff --git a/src/components/structures/LoggedInView.js b/src/components/structures/LoggedInView.js
index d95d5cd652..231a6ef6b6 100644
--- a/src/components/structures/LoggedInView.js
+++ b/src/components/structures/LoggedInView.js
@@ -189,13 +189,13 @@ const LoggedInView = React.createClass({
_updateServerNoticeEvents: async function() {
const roomLists = RoomListStore.getRoomLists();
if (!roomLists['m.server_notice']) return [];
-
+
const pinnedEvents = [];
for (const room of roomLists['m.server_notice']) {
const pinStateEvent = room.currentState.getStateEvents("m.room.pinned_events", "");
if (!pinStateEvent || !pinStateEvent.getContent().pinned) continue;
-
+
const pinnedEventIds = pinStateEvent.getContent().pinned.slice(0, MAX_PINNED_NOTICES_PER_ROOM);
for (const eventId of pinnedEventIds) {
const timeline = await this._matrixClient.getEventTimeline(room.getUnfilteredTimelineSet(), eventId, 0);
@@ -207,7 +207,7 @@ const LoggedInView = React.createClass({
serverNoticeEvents: pinnedEvents,
});
},
-
+
_onKeyDown: function(ev) {
/*
diff --git a/src/components/structures/LoginBox.js b/src/components/structures/LoginBox.js
index a2269706ee..168014daa5 100644
--- a/src/components/structures/LoginBox.js
+++ b/src/components/structures/LoginBox.js
@@ -53,5 +53,5 @@ module.exports = React.createClass({
{ loginButton }
);
- }
+ },
});
diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js
index f417932fd0..4c7d004015 100644
--- a/src/components/structures/RoomDirectory.js
+++ b/src/components/structures/RoomDirectory.js
@@ -16,18 +16,18 @@ limitations under the License.
'use strict';
-var React = require('react');
+const React = require('react');
-var MatrixClientPeg = require('../../MatrixClientPeg');
-var ContentRepo = require("matrix-js-sdk").ContentRepo;
-var Modal = require('../../Modal');
-var sdk = require('../../index');
-var dis = require('../../dispatcher');
+const MatrixClientPeg = require('../../MatrixClientPeg');
+const ContentRepo = require("matrix-js-sdk").ContentRepo;
+const Modal = require('../../Modal');
+const sdk = require('../../index');
+const dis = require('../../dispatcher');
-var linkify = require('linkifyjs');
-var linkifyString = require('linkifyjs/string');
-var linkifyMatrix = require('../../linkify-matrix');
-var sanitizeHtml = require('sanitize-html');
+const linkify = require('linkifyjs');
+const linkifyString = require('linkifyjs/string');
+const linkifyMatrix = require('../../linkify-matrix');
+const sanitizeHtml = require('sanitize-html');
import Promise from 'bluebird';
import { _t } from '../../languageHandler';
@@ -46,7 +46,7 @@ module.exports = React.createClass({
getDefaultProps: function() {
return {
config: {},
- }
+ };
},
getInitialState: function() {
@@ -58,7 +58,7 @@ module.exports = React.createClass({
includeAll: false,
roomServer: null,
filterString: null,
- }
+ };
},
componentWillMount: function() {
@@ -134,13 +134,12 @@ module.exports = React.createClass({
opts.include_all_networks = true;
}
if (this.nextBatch) opts.since = this.nextBatch;
- if (my_filter_string) opts.filter = { generic_search_term: my_filter_string } ;
+ if (my_filter_string) opts.filter = { generic_search_term: my_filter_string };
return MatrixClientPeg.get().publicRooms(opts).then((data) => {
if (
my_filter_string != this.state.filterString ||
my_server != this.state.roomServer ||
- my_next_batch != this.nextBatch)
- {
+ my_next_batch != this.nextBatch) {
// if the filter or server has changed since this request was sent,
// throw away the result (don't even clear the busy flag
// since we must still have a request in flight)
@@ -163,8 +162,7 @@ module.exports = React.createClass({
if (
my_filter_string != this.state.filterString ||
my_server != this.state.roomServer ||
- my_next_batch != this.nextBatch)
- {
+ my_next_batch != this.nextBatch) {
// as above: we don't care about errors for old
// requests either
return;
@@ -177,10 +175,10 @@ module.exports = React.createClass({
this.setState({ loading: false });
console.error("Failed to get publicRooms: %s", JSON.stringify(err));
- var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
+ const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createTrackedDialog('Failed to get public room list', '', ErrorDialog, {
title: _t('Failed to get public room list'),
- description: ((err && err.message) ? err.message : _t('The server may be unavailable or overloaded'))
+ description: ((err && err.message) ? err.message : _t('The server may be unavailable or overloaded')),
});
});
},
@@ -193,13 +191,13 @@ module.exports = React.createClass({
* this needs SPEC-417.
*/
removeFromDirectory: function(room) {
- var alias = get_display_alias_for_room(room);
- var name = room.name || alias || _t('Unnamed room');
+ const alias = get_display_alias_for_room(room);
+ const name = room.name || alias || _t('Unnamed room');
- var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
- var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
+ const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
+ const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
- var desc;
+ let desc;
if (alias) {
desc = _t('Delete the room alias %(alias)s and remove %(name)s from the directory?', {alias: alias, name: name});
} else {
@@ -212,9 +210,9 @@ module.exports = React.createClass({
onFinished: (should_delete) => {
if (!should_delete) return;
- var Loader = sdk.getComponent("elements.Spinner");
- var modal = Modal.createDialog(Loader);
- var step = _t('remove %(name)s from the directory.', {name: name});
+ const Loader = sdk.getComponent("elements.Spinner");
+ const modal = Modal.createDialog(Loader);
+ let step = _t('remove %(name)s from the directory.', {name: name});
MatrixClientPeg.get().setRoomDirectoryVisibility(room.room_id, 'private').then(() => {
if (!alias) return;
@@ -229,10 +227,10 @@ module.exports = React.createClass({
console.error("Failed to " + step + ": " + err);
Modal.createTrackedDialog('Remove from Directory Error', '', ErrorDialog, {
title: _t('Error'),
- description: ((err && err.message) ? err.message : _t('The server may be unavailable or overloaded'))
+ description: ((err && err.message) ? err.message : _t('The server may be unavailable or overloaded')),
});
});
- }
+ },
});
},
@@ -347,7 +345,7 @@ module.exports = React.createClass({
},
showRoom: function(room, room_alias) {
- var payload = {action: 'view_room'};
+ const payload = {action: 'view_room'};
if (room) {
// Don't let the user view a room they won't be able to either
// peek or join: fail earlier so they don't have to click back
@@ -383,16 +381,16 @@ module.exports = React.createClass({
},
getRows: function() {
- var BaseAvatar = sdk.getComponent('avatars.BaseAvatar');
+ const BaseAvatar = sdk.getComponent('avatars.BaseAvatar');
if (!this.state.publicRooms) return [];
- var rooms = this.state.publicRooms;
- var rows = [];
- var self = this;
- var guestRead, guestJoin, perms;
- for (var i = 0; i < rooms.length; i++) {
- var name = rooms[i].name || get_display_alias_for_room(rooms[i]) || _t('Unnamed room');
+ const rooms = this.state.publicRooms;
+ const rows = [];
+ const self = this;
+ let guestRead; let guestJoin; let perms;
+ for (let i = 0; i < rooms.length; i++) {
+ const name = rooms[i].name || get_display_alias_for_room(rooms[i]) || _t('Unnamed room');
guestRead = null;
guestJoin = null;
@@ -412,7 +410,7 @@ module.exports = React.createClass({
perms = {guestRead}{guestJoin}
;
}
- var topic = rooms[i].topic || '';
+ let topic = rooms[i].topic || '';
topic = linkifyString(sanitizeHtml(topic));
rows.push(
@@ -432,14 +430,14 @@ module.exports = React.createClass({
{ name }
{ perms }
+ onClick={ function(e) { e.stopPropagation(); } }
+ dangerouslySetInnerHTML={{ __html: topic }} />
{ get_display_alias_for_room(rooms[i]) }
{ rooms[i].num_joined_members }
|
-
+ ,
);
}
return rows;
@@ -524,7 +522,7 @@ module.exports = React.createClass({
onFillRequest={ this.onFillRequest }
stickyBottom={false}
startAtBottom={false}
- onResize={function(){}}
+ onResize={function() {}}
>
{ scrollpanel_content }
;
@@ -577,11 +575,11 @@ module.exports = React.createClass({
);
- }
+ },
});
// Similar to matrix-react-sdk's MatrixTools.getDisplayAliasForRoom
// but works with the objects we get from the public room list
function get_display_alias_for_room(room) {
- return room.canonical_alias || (room.aliases ? room.aliases[0] : "");
+ return room.canonical_alias || (room.aliases ? room.aliases[0] : "");
}
diff --git a/src/components/structures/RoomStatusBar.js b/src/components/structures/RoomStatusBar.js
index c6a6e1e2d3..b4d70f3397 100644
--- a/src/components/structures/RoomStatusBar.js
+++ b/src/components/structures/RoomStatusBar.js
@@ -37,7 +37,7 @@ function getUnsentMessages(room) {
return room.getPendingEvents().filter(function(ev) {
return ev.status === Matrix.EventStatus.NOT_SENT;
});
-};
+}
module.exports = React.createClass({
displayName: 'RoomStatusBar',
@@ -303,7 +303,7 @@ module.exports = React.createClass({
const errorIsMauError = Boolean(
this.state.syncStateData &&
this.state.syncStateData.error &&
- this.state.syncStateData.error.errcode === 'M_RESOURCE_LIMIT_EXCEEDED'
+ this.state.syncStateData.error.errcode === 'M_RESOURCE_LIMIT_EXCEEDED',
);
return this.state.syncState === "ERROR" && !errorIsMauError;
},
diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js
index 53644af78f..dd57bd7636 100644
--- a/src/components/structures/RoomView.js
+++ b/src/components/structures/RoomView.js
@@ -1673,7 +1673,7 @@ module.exports = React.createClass({
);
- let messageComposer, searchInfo;
+ let messageComposer; let searchInfo;
const canSpeak = (
// joined and not showing search results
myMembership === 'join' && !this.state.searchResults
@@ -1692,7 +1692,7 @@ module.exports = React.createClass({
if (MatrixClientPeg.get().isGuest()) {
const LoginBox = sdk.getComponent('structures.LoginBox');
- messageComposer = ;
+ messageComposer = ;
}
// TODO: Why aren't we storing the term/scope/count in this format
@@ -1706,7 +1706,7 @@ module.exports = React.createClass({
}
if (inCall) {
- let zoomButton, voiceMuteButton, videoMuteButton;
+ let zoomButton; let voiceMuteButton; let videoMuteButton;
if (call.type === "video") {
zoomButton = (
diff --git a/src/components/structures/SearchBox.js b/src/components/structures/SearchBox.js
index 459df3bd26..d1f4cd30fa 100644
--- a/src/components/structures/SearchBox.js
+++ b/src/components/structures/SearchBox.js
@@ -72,7 +72,7 @@ module.exports = React.createClass({
function() {
this.props.onSearch(this.refs.search.value);
},
- 100
+ 100,
),
onToggleCollapse: function(show) {
@@ -80,8 +80,7 @@ module.exports = React.createClass({
dis.dispatch({
action: 'show_left_panel',
});
- }
- else {
+ } else {
dis.dispatch({
action: 'hide_left_panel',
});
@@ -103,25 +102,24 @@ module.exports = React.createClass({
},
render: function() {
- var TintableSvg = sdk.getComponent('elements.TintableSvg');
+ const TintableSvg = sdk.getComponent('elements.TintableSvg');
- var collapseTabIndex = this.refs.search && this.refs.search.value !== "" ? "-1" : "0";
+ const collapseTabIndex = this.refs.search && this.refs.search.value !== "" ? "-1" : "0";
- var toggleCollapse;
+ let toggleCollapse;
if (this.props.collapsed) {
toggleCollapse =
-
-
- }
- else {
+
+ ;
+ } else {
toggleCollapse =
-
-
+
+ ;
}
- var searchControls;
+ let searchControls;
if (!this.props.collapsed) {
searchControls = [
this.state.searchTerm.length > 0 ?
@@ -148,16 +146,16 @@ module.exports = React.createClass({
onChange={ this.onChange }
onKeyDown={ this._onKeyDown }
placeholder={ _t('Filter room names') }
- />
+ />,
];
}
- var self = this;
+ const self = this;
return (
{ searchControls }
{ toggleCollapse }
);
- }
+ },
});
diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js
index e06c652924..44d14cd7cf 100644
--- a/src/components/structures/TimelinePanel.js
+++ b/src/components/structures/TimelinePanel.js
@@ -829,7 +829,7 @@ var TimelinePanel = React.createClass({
// 4. Also, if pos === null, the event might not be paginated - show the unread bar
const pos = this.getReadMarkerPosition();
return this.state.readMarkerEventId !== null && // 1.
- this.state.readMarkerEventId !== this._getCurrentReadReceipt() && // 2.
+ this.state.readMarkerEventId !== this._getCurrentReadReceipt() && // 2.
(pos < 0 || pos === null); // 3., 4.
},
diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js
index 772eb70dde..40dccd7839 100644
--- a/src/components/structures/UserSettings.js
+++ b/src/components/structures/UserSettings.js
@@ -845,7 +845,7 @@ module.exports = React.createClass({
SettingsStore.getLabsFeatures().forEach((featureId) => {
// TODO: this ought to be a separate component so that we don't need
// to rebind the onChange each time we render
- const onChange = async (e) => {
+ const onChange = async(e) => {
const checked = e.target.checked;
if (featureId === "feature_lazyloading") {
const confirmed = await this._onLazyLoadChanging(checked);
diff --git a/src/components/structures/ViewSource.js b/src/components/structures/ViewSource.js
index 3a5d35a561..4844149f59 100644
--- a/src/components/structures/ViewSource.js
+++ b/src/components/structures/ViewSource.js
@@ -53,5 +53,5 @@ module.exports = React.createClass({
);
- }
+ },
});
diff --git a/src/components/views/avatars/MemberAvatar.js b/src/components/views/avatars/MemberAvatar.js
index d191368b17..a9db1165e8 100644
--- a/src/components/views/avatars/MemberAvatar.js
+++ b/src/components/views/avatars/MemberAvatar.js
@@ -79,7 +79,7 @@ module.exports = React.createClass({
const BaseAvatar = sdk.getComponent("avatars.BaseAvatar");
let {member, fallbackUserId, onClick, viewUserOnClick, ...otherProps} = this.props;
- let userId = member ? member.userId : fallbackUserId;
+ const userId = member ? member.userId : fallbackUserId;
if (viewUserOnClick) {
onClick = () => {
diff --git a/src/components/views/context_menus/GroupInviteTileContextMenu.js b/src/components/views/context_menus/GroupInviteTileContextMenu.js
index e30acca16d..2dd611843a 100644
--- a/src/components/views/context_menus/GroupInviteTileContextMenu.js
+++ b/src/components/views/context_menus/GroupInviteTileContextMenu.js
@@ -48,7 +48,7 @@ export default class GroupInviteTileContextMenu extends React.Component {
Modal.createTrackedDialog('Reject community invite', '', QuestionDialog, {
title: _t('Reject invitation'),
description: _t('Are you sure you want to reject the invitation?'),
- onFinished: async (shouldLeave) => {
+ onFinished: async(shouldLeave) => {
if (!shouldLeave) return;
// FIXME: controller shouldn't be loading a view :(
diff --git a/src/components/views/dialogs/ChangelogDialog.js b/src/components/views/dialogs/ChangelogDialog.js
index e71fcdb624..b93678b2ab 100644
--- a/src/components/views/dialogs/ChangelogDialog.js
+++ b/src/components/views/dialogs/ChangelogDialog.js
@@ -31,13 +31,13 @@ export default class ChangelogDialog extends React.Component {
componentDidMount() {
const version = this.props.newVersion.split('-');
const version2 = this.props.version.split('-');
- if(version == null || version2 == null) return;
+ if (version == null || version2 == null) return;
// parse versions of form: [vectorversion]-react-[react-sdk-version]-js-[js-sdk-version]
- for(let i=0; i {
- if(body == null) return;
+ if (body == null) return;
this.setState({[REPOS[i]]: JSON.parse(body).commits});
});
}
@@ -66,7 +66,7 @@ export default class ChangelogDialog extends React.Component {
{this.state[repo].map(this._elementsForCommit)}
- )
+ );
});
const content = (
@@ -83,7 +83,7 @@ export default class ChangelogDialog extends React.Component {
button={_t("Update")}
onFinished={this.props.onFinished}
/>
- )
+ );
}
}
diff --git a/src/components/views/dialogs/ChatCreateOrReuseDialog.js b/src/components/views/dialogs/ChatCreateOrReuseDialog.js
index 550abe5299..19b7d83717 100644
--- a/src/components/views/dialogs/ChatCreateOrReuseDialog.js
+++ b/src/components/views/dialogs/ChatCreateOrReuseDialog.js
@@ -26,7 +26,6 @@ import Unread from '../../../Unread';
import classNames from 'classnames';
export default class ChatCreateOrReuseDialog extends React.Component {
-
constructor(props) {
super(props);
this.onFinished = this.onFinished.bind(this);
diff --git a/src/components/views/directory/NetworkDropdown.js b/src/components/views/directory/NetworkDropdown.js
index b45bd286f2..ad51f501fb 100644
--- a/src/components/views/directory/NetworkDropdown.js
+++ b/src/components/views/directory/NetworkDropdown.js
@@ -153,8 +153,8 @@ export default class NetworkDropdown extends React.Component {
const sortedInstances = this.props.protocols[proto].instances;
sortedInstances.sort(function(x, y) {
- const a = x.desc
- const b = y.desc
+ const a = x.desc;
+ const b = y.desc;
if (a < b) {
return -1;
} else if (a > b) {
@@ -208,7 +208,7 @@ export default class NetworkDropdown extends React.Component {
return
{icon}
{name}
-
+ ;
}
render() {
@@ -223,11 +223,11 @@ export default class NetworkDropdown extends React.Component {
current_value =
+ />;
} else {
const instance = instanceForInstanceId(this.props.protocols, this.state.selectedInstanceId);
current_value = this._makeMenuOption(
- this.state.selectedServer, instance, this.state.includeAll, false
+ this.state.selectedServer, instance, this.state.includeAll, false,
);
}
diff --git a/src/components/views/elements/DeviceVerifyButtons.js b/src/components/views/elements/DeviceVerifyButtons.js
index c775cba610..b88fbdfc06 100644
--- a/src/components/views/elements/DeviceVerifyButtons.js
+++ b/src/components/views/elements/DeviceVerifyButtons.js
@@ -78,7 +78,7 @@ export default React.createClass({
},
render: function() {
- let blacklistButton = null, verifyButton = null;
+ let blacklistButton = null; let verifyButton = null;
if (this.state.device.isBlocked()) {
blacklistButton = (
diff --git a/src/components/views/elements/EditableTextContainer.js b/src/components/views/elements/EditableTextContainer.js
index 064d2f1c39..3bf37df951 100644
--- a/src/components/views/elements/EditableTextContainer.js
+++ b/src/components/views/elements/EditableTextContainer.js
@@ -122,7 +122,6 @@ export default class EditableTextContainer extends React.Component {
);
}
}
-
}
EditableTextContainer.propTypes = {
diff --git a/src/components/views/elements/ImageView.js b/src/components/views/elements/ImageView.js
index f3ad5a9696..4ac5eda170 100644
--- a/src/components/views/elements/ImageView.js
+++ b/src/components/views/elements/ImageView.js
@@ -16,13 +16,13 @@ limitations under the License.
'use strict';
-var React = require('react');
+const React = require('react');
-var MatrixClientPeg = require('../../../MatrixClientPeg');
+const MatrixClientPeg = require('../../../MatrixClientPeg');
import {formatDate} from '../../../DateUtils';
-var filesize = require('filesize');
-var AccessibleButton = require('../../../components/views/elements/AccessibleButton');
+const filesize = require('filesize');
+const AccessibleButton = require('../../../components/views/elements/AccessibleButton');
const Modal = require('../../../Modal');
const sdk = require('../../../index');
import { _t } from '../../../languageHandler';
@@ -69,24 +69,24 @@ module.exports = React.createClass({
Modal.createTrackedDialog('Confirm Redact Dialog', 'Image View', ConfirmRedactDialog, {
onFinished: (proceed) => {
if (!proceed) return;
- var self = this;
+ const self = this;
MatrixClientPeg.get().redactEvent(
- this.props.mxEvent.getRoomId(), this.props.mxEvent.getId()
+ this.props.mxEvent.getRoomId(), this.props.mxEvent.getId(),
).catch(function(e) {
- var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
+ const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
// display error message stating you couldn't delete this.
- var code = e.errcode || e.statusCode;
+ const code = e.errcode || e.statusCode;
Modal.createTrackedDialog('You cannot delete this image.', '', ErrorDialog, {
title: _t('Error'),
- description: _t('You cannot delete this image. (%(code)s)', {code: code})
+ description: _t('You cannot delete this image. (%(code)s)', {code: code}),
});
}).done();
- }
+ },
});
},
- getName: function () {
- var name = this.props.name;
+ getName: function() {
+ let name = this.props.name;
if (name && this.props.link) {
name = { name };
}
@@ -94,7 +94,6 @@ module.exports = React.createClass({
},
render: function() {
-
/*
// In theory max-width: 80%, max-height: 80% on the CSS should work
// but in practice, it doesn't, so do it manually:
@@ -123,7 +122,7 @@ module.exports = React.createClass({
height: displayHeight
};
*/
- var style, res;
+ let style; let res;
if (this.props.width && this.props.height) {
style = {
@@ -133,23 +132,22 @@ module.exports = React.createClass({
res = style.width + "x" + style.height + "px";
}
- var size;
+ let size;
if (this.props.fileSize) {
size = filesize(this.props.fileSize);
}
- var size_res;
+ let size_res;
if (size && res) {
size_res = size + ", " + res;
- }
- else {
+ } else {
size_res = size || res;
}
- var showEventMeta = !!this.props.mxEvent;
+ const showEventMeta = !!this.props.mxEvent;
- var eventMeta;
- if(showEventMeta) {
+ let eventMeta;
+ if (showEventMeta) {
// Figure out the sender, defaulting to mxid
let sender = this.props.mxEvent.getSender();
const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId());
@@ -163,8 +161,8 @@ module.exports = React.createClass({
);
}
- var eventRedact;
- if(showEventMeta) {
+ let eventRedact;
+ if (showEventMeta) {
eventRedact = (
{ _t('Remove') }
);
@@ -175,10 +173,10 @@ module.exports = React.createClass({
-
+
-
+
);
- }
+ },
});
diff --git a/src/components/views/elements/InlineSpinner.js b/src/components/views/elements/InlineSpinner.js
index adb916fcf0..cce4705512 100644
--- a/src/components/views/elements/InlineSpinner.js
+++ b/src/components/views/elements/InlineSpinner.js
@@ -20,14 +20,14 @@ module.exports = React.createClass({
displayName: 'InlineSpinner',
render: function() {
- var w = this.props.w || 16;
- var h = this.props.h || 16;
- var imgClass = this.props.imgClassName || "";
+ const w = this.props.w || 16;
+ const h = this.props.h || 16;
+ const imgClass = this.props.imgClassName || "";
return (
-
+
);
- }
+ },
});
diff --git a/src/components/views/elements/PersistedElement.js b/src/components/views/elements/PersistedElement.js
index ff839de2a9..d23d6488b6 100644
--- a/src/components/views/elements/PersistedElement.js
+++ b/src/components/views/elements/PersistedElement.js
@@ -54,7 +54,6 @@ function getOrCreateContainer(containerId) {
* bounding rect as the parent of PE.
*/
export default class PersistedElement extends React.Component {
-
static propTypes = {
// Unique identifier for this PersistedElement instance
// Any PersistedElements with the same persistKey will use
diff --git a/src/components/views/elements/Spinner.js b/src/components/views/elements/Spinner.js
index 2b620f12c5..67fde4bf66 100644
--- a/src/components/views/elements/Spinner.js
+++ b/src/components/views/elements/Spinner.js
@@ -16,19 +16,19 @@ limitations under the License.
'use strict';
-var React = require('react');
+const React = require('react');
module.exports = React.createClass({
displayName: 'Spinner',
render: function() {
- var w = this.props.w || 32;
- var h = this.props.h || 32;
- var imgClass = this.props.imgClassName || "";
+ const w = this.props.w || 32;
+ const h = this.props.h || 32;
+ const imgClass = this.props.imgClassName || "";
return (
-
+
);
- }
+ },
});
diff --git a/src/components/views/elements/TintableSvgButton.js b/src/components/views/elements/TintableSvgButton.js
index 4bfe46d43f..a3f5b7db5d 100644
--- a/src/components/views/elements/TintableSvgButton.js
+++ b/src/components/views/elements/TintableSvgButton.js
@@ -20,7 +20,6 @@ import TintableSvg from './TintableSvg';
import AccessibleButton from './AccessibleButton';
export default class TintableSvgButton extends React.Component {
-
constructor(props) {
super(props);
}
diff --git a/src/components/views/globals/MatrixToolbar.js b/src/components/views/globals/MatrixToolbar.js
index 45feede5a0..400d9e0c83 100644
--- a/src/components/views/globals/MatrixToolbar.js
+++ b/src/components/views/globals/MatrixToolbar.js
@@ -39,7 +39,7 @@ module.exports = React.createClass({
-
+
);
},
diff --git a/src/components/views/globals/NewVersionBar.js b/src/components/views/globals/NewVersionBar.js
index 1bd0bde526..47eed4dc59 100644
--- a/src/components/views/globals/NewVersionBar.js
+++ b/src/components/views/globals/NewVersionBar.js
@@ -45,10 +45,10 @@ export default React.createClass({
description:
{releaseNotes}
,
button: _t("Update"),
onFinished: (update) => {
- if(update && PlatformPeg.get()) {
+ if (update && PlatformPeg.get()) {
PlatformPeg.get().installUpdate();
}
- }
+ },
});
},
@@ -58,10 +58,10 @@ export default React.createClass({
version: this.props.version,
newVersion: this.props.newVersion,
onFinished: (update) => {
- if(update && PlatformPeg.get()) {
+ if (update && PlatformPeg.get()) {
PlatformPeg.get().installUpdate();
}
- }
+ },
});
},
@@ -103,5 +103,5 @@ export default React.createClass({
{action_button}
);
- }
+ },
});
diff --git a/src/components/views/globals/UpdateCheckBar.js b/src/components/views/globals/UpdateCheckBar.js
index e499ddab31..4610dbdb12 100644
--- a/src/components/views/globals/UpdateCheckBar.js
+++ b/src/components/views/globals/UpdateCheckBar.js
@@ -32,14 +32,14 @@ export default React.createClass({
getDefaultProps: function() {
return {
detail: '',
- }
+ };
},
getStatusText: function() {
// we can't import the enum from riot-web as we don't want matrix-react-sdk
// to depend on riot-web. so we grab it as a normal object via API instead.
const updateCheckStatusEnum = PlatformPeg.get().getUpdateCheckStatusEnum();
- switch(this.props.status) {
+ switch (this.props.status) {
case updateCheckStatusEnum.ERROR:
return _t('Error encountered (%(errorDetail)s).', { errorDetail: this.props.detail });
case updateCheckStatusEnum.CHECKING:
@@ -59,7 +59,7 @@ export default React.createClass({
const message = this.getStatusText();
const warning = _t('Warning');
- if (!'getUpdateCheckStatusEnum' in PlatformPeg.get()) {
+ if (!('getUpdateCheckStatusEnum' in PlatformPeg.get())) {
return ;
}
@@ -83,9 +83,9 @@ export default React.createClass({
{message}
-
+
);
- }
+ },
});
diff --git a/src/components/views/login/InteractiveAuthEntryComponents.js b/src/components/views/login/InteractiveAuthEntryComponents.js
index 6e0e5d538a..481cdc60b2 100644
--- a/src/components/views/login/InteractiveAuthEntryComponents.js
+++ b/src/components/views/login/InteractiveAuthEntryComponents.js
@@ -296,7 +296,7 @@ export const TermsAuthEntry = React.createClass({
return ;
}
- let checkboxes = [];
+ const checkboxes = [];
let allChecked = true;
for (const policy of this.state.policies) {
const checked = this.state.toggledPolicies[policy.id];
@@ -306,7 +306,7 @@ export const TermsAuthEntry = React.createClass({
+ ,
);
}
diff --git a/src/components/views/room_settings/AliasSettings.js b/src/components/views/room_settings/AliasSettings.js
index 92a025f10c..de5d3db625 100644
--- a/src/components/views/room_settings/AliasSettings.js
+++ b/src/components/views/room_settings/AliasSettings.js
@@ -103,7 +103,7 @@ module.exports = React.createClass({
oldCanonicalAlias = this.props.canonicalAliasEvent.getContent().alias;
}
- let newCanonicalAlias = this.state.canonicalAlias;
+ const newCanonicalAlias = this.state.canonicalAlias;
if (this.props.canSetCanonicalAlias && oldCanonicalAlias !== newCanonicalAlias) {
console.log("AliasSettings: Updating canonical alias");
@@ -167,7 +167,7 @@ module.exports = React.createClass({
if (!this.props.canonicalAlias) {
this.setState({
- canonicalAlias: alias
+ canonicalAlias: alias,
});
}
},
diff --git a/src/components/views/rooms/Autocomplete.js b/src/components/views/rooms/Autocomplete.js
index 757204f0c8..e75456ea50 100644
--- a/src/components/views/rooms/Autocomplete.js
+++ b/src/components/views/rooms/Autocomplete.js
@@ -33,7 +33,6 @@ import Autocompleter from '../../../autocomplete/Autocompleter';
const COMPOSER_SELECTED = 0;
export default class Autocomplete extends React.Component {
-
constructor(props) {
super(props);
diff --git a/src/components/views/rooms/LinkPreviewWidget.js b/src/components/views/rooms/LinkPreviewWidget.js
index 2c70f36e07..7f74176878 100644
--- a/src/components/views/rooms/LinkPreviewWidget.js
+++ b/src/components/views/rooms/LinkPreviewWidget.js
@@ -107,7 +107,7 @@ module.exports = React.createClass({
// FIXME: do we want to factor out all image displaying between this and MImageBody - especially for lightboxing?
let image = p["og:image"];
- let imageMaxWidth = 100, imageMaxHeight = 100;
+ const imageMaxWidth = 100; const imageMaxHeight = 100;
if (image && image.startsWith("mxc://")) {
image = MatrixClientPeg.get().mxcUrlToHttp(image, imageMaxWidth, imageMaxHeight);
}
diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js
index 037957c868..7ff52ecbb6 100644
--- a/src/components/views/rooms/MemberInfo.js
+++ b/src/components/views/rooms/MemberInfo.js
@@ -712,7 +712,7 @@ module.exports = withMatrixClient(React.createClass({
if (!member || !member.membership || member.membership === 'leave') {
const roomId = member && member.roomId ? member.roomId : RoomViewStore.getRoomId();
- const onInviteUserButton = async () => {
+ const onInviteUserButton = async() => {
try {
await cli.invite(roomId, member.userId);
} catch (err) {
diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js
index 66f3fdaa97..8df6a76836 100644
--- a/src/components/views/rooms/MessageComposer.js
+++ b/src/components/views/rooms/MessageComposer.js
@@ -269,7 +269,7 @@ export default class MessageComposer extends React.Component {
);
}
- let e2eImg, e2eTitle, e2eClass;
+ let e2eImg; let e2eTitle; let e2eClass;
const roomIsEncrypted = MatrixClientPeg.get().isRoomEncrypted(this.props.room.roomId);
if (roomIsEncrypted) {
// FIXME: show a /!\ if there are untrusted devices in the room...
@@ -429,7 +429,7 @@ export default class MessageComposer extends React.Component {
className="mx_MessageComposer_formatbar_cancel mx_filterFlipColor"
src="img/icon-text-cancel.svg" />
-
+ ;
}
return (
diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js
index 6f56d35105..14d394ab41 100644
--- a/src/components/views/rooms/MessageComposerInput.js
+++ b/src/components/views/rooms/MessageComposerInput.js
@@ -67,7 +67,7 @@ const EMOJI_UNICODE_TO_SHORTNAME = mapUnicodeToShort();
const REGEX_EMOJI_WHITESPACE = new RegExp('(?:^|\\s)(' + asciiRegexp + ')\\s$');
const EMOJI_REGEX = new RegExp(unicodeRegexp, 'g');
-const TYPING_USER_TIMEOUT = 10000, TYPING_SERVER_TIMEOUT = 30000;
+const TYPING_USER_TIMEOUT = 10000; const TYPING_SERVER_TIMEOUT = 30000;
const ENTITY_TYPES = {
AT_ROOM_PILL: 'ATROOMPILL',
@@ -175,8 +175,8 @@ export default class MessageComposerInput extends React.Component {
// see https://github.com/ianstormtaylor/slate/issues/762#issuecomment-304855095
this.direction = '';
- this.plainWithMdPills = new PlainWithPillsSerializer({ pillFormat: 'md' });
- this.plainWithIdPills = new PlainWithPillsSerializer({ pillFormat: 'id' });
+ this.plainWithMdPills = new PlainWithPillsSerializer({ pillFormat: 'md' });
+ this.plainWithIdPills = new PlainWithPillsSerializer({ pillFormat: 'id' });
this.plainWithPlainPills = new PlainWithPillsSerializer({ pillFormat: 'plain' });
this.md = new Md({
@@ -1078,7 +1078,7 @@ export default class MessageComposerInput extends React.Component {
// only look for commands if the first block contains simple unformatted text
// i.e. no pills or rich-text formatting and begins with a /.
- let cmd, commandText;
+ let cmd; let commandText;
const firstChild = editorState.document.nodes.get(0);
const firstGrandChild = firstChild && firstChild.nodes.get(0);
if (firstChild && firstGrandChild &&
@@ -1260,7 +1260,7 @@ export default class MessageComposerInput extends React.Component {
}
};
- selectHistory = async (up) => {
+ selectHistory = async(up) => {
const delta = up ? -1 : 1;
// True if we are not currently selecting history, but composing a message
@@ -1308,7 +1308,7 @@ export default class MessageComposerInput extends React.Component {
return true;
};
- onTab = async (e) => {
+ onTab = async(e) => {
this.setState({
someCompletions: null,
});
@@ -1330,7 +1330,7 @@ export default class MessageComposerInput extends React.Component {
up ? this.autocomplete.onUpArrow() : this.autocomplete.onDownArrow();
};
- onEscape = async (e) => {
+ onEscape = async(e) => {
e.preventDefault();
if (this.autocomplete) {
this.autocomplete.onEscape(e);
@@ -1349,7 +1349,7 @@ export default class MessageComposerInput extends React.Component {
/* If passed null, restores the original editor content from state.originalEditorState.
* If passed a non-null displayedCompletion, modifies state.originalEditorState to compute new state.editorState.
*/
- setDisplayedCompletion = async (displayedCompletion: ?Completion): boolean => {
+ setDisplayedCompletion = async(displayedCompletion: ?Completion): boolean => {
const activeEditorState = this.state.originalEditorState || this.state.editorState;
if (displayedCompletion == null) {
diff --git a/src/components/views/rooms/RoomPreviewBar.js b/src/components/views/rooms/RoomPreviewBar.js
index 9d3dbe5217..3c767b726a 100644
--- a/src/components/views/rooms/RoomPreviewBar.js
+++ b/src/components/views/rooms/RoomPreviewBar.js
@@ -93,7 +93,7 @@ module.exports = React.createClass({
},
render: function() {
- let joinBlock, previewBlock;
+ let joinBlock; let previewBlock;
if (this.props.spinner || this.state.busy) {
const Spinner = sdk.getComponent("elements.Spinner");
diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js
index b69938a117..8cd559f2ea 100644
--- a/src/components/views/rooms/RoomSettings.js
+++ b/src/components/views/rooms/RoomSettings.js
@@ -657,31 +657,31 @@ module.exports = React.createClass({
const userLevels = powerLevels.users || {};
const powerLevelDescriptors = {
- users_default: {
+ "users_default": {
desc: _t('The default role for new room members is'),
defaultValue: 0,
},
- events_default: {
+ "events_default": {
desc: _t('To send messages, you must be a'),
defaultValue: 0,
},
- invite: {
+ "invite": {
desc: _t('To invite users into the room, you must be a'),
defaultValue: 50,
},
- state_default: {
+ "state_default": {
desc: _t('To configure the room, you must be a'),
defaultValue: 50,
},
- kick: {
+ "kick": {
desc: _t('To kick users, you must be a'),
defaultValue: 50,
},
- ban: {
+ "ban": {
desc: _t('To ban users, you must be a'),
defaultValue: 50,
},
- redact: {
+ "redact": {
desc: _t('To remove other users\' messages, you must be a'),
defaultValue: 50,
},
diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js
index ea727a03b5..72ad2943aa 100644
--- a/src/components/views/settings/Notifications.js
+++ b/src/components/views/settings/Notifications.js
@@ -67,7 +67,7 @@ module.exports = React.createClass({
phases: {
LOADING: "LOADING", // The component is loading or sending data to the hs
DISPLAY: "DISPLAY", // The component is ready and display data
- ERROR: "ERROR", // There was an error
+ ERROR: "ERROR", // There was an error
},
propTypes: {
@@ -86,14 +86,14 @@ module.exports = React.createClass({
getInitialState: function() {
return {
phase: this.phases.LOADING,
- masterPushRule: undefined, // The master rule ('.m.rule.master')
- vectorPushRules: [], // HS default push rules displayed in Vector UI
- vectorContentRules: { // Keyword push rules displayed in Vector UI
+ masterPushRule: undefined, // The master rule ('.m.rule.master')
+ vectorPushRules: [], // HS default push rules displayed in Vector UI
+ vectorContentRules: { // Keyword push rules displayed in Vector UI
vectorState: PushRuleVectorState.ON,
rules: [],
},
- externalPushRules: [], // Push rules (except content rule) that have been defined outside Vector UI
- externalContentRules: [], // Keyword push rules that have been defined outside Vector UI
+ externalPushRules: [], // Push rules (except content rule) that have been defined outside Vector UI
+ externalContentRules: [], // Keyword push rules that have been defined outside Vector UI
};
},
@@ -290,7 +290,7 @@ module.exports = React.createClass({
for (const i in this.state.vectorContentRules.rules) {
const rule = this.state.vectorContentRules.rules[i];
- let enabled, actions;
+ let enabled; let actions;
switch (newPushRuleVectorState) {
case PushRuleVectorState.ON:
if (rule.actions.length !== 1) {
diff --git a/src/notifications/StandardActions.js b/src/notifications/StandardActions.js
index 22a8f1db40..30d6ea5975 100644
--- a/src/notifications/StandardActions.js
+++ b/src/notifications/StandardActions.js
@@ -16,9 +16,9 @@ limitations under the License.
'use strict';
-var NotificationUtils = require('./NotificationUtils');
+const NotificationUtils = require('./NotificationUtils');
-var encodeActions = NotificationUtils.encodeActions;
+const encodeActions = NotificationUtils.encodeActions;
module.exports = {
ACTION_NOTIFY: encodeActions({notify: true}),
diff --git a/src/settings/SettingsStore.js b/src/settings/SettingsStore.js
index cb6d83e884..bb3f412a9b 100644
--- a/src/settings/SettingsStore.js
+++ b/src/settings/SettingsStore.js
@@ -248,7 +248,7 @@ export default class SettingsStore {
if (actualValue !== undefined && actualValue !== null) return actualValue;
return calculatedValue;
}
- /* eslint-disable valid-jsdoc */ //https://github.com/eslint/eslint/issues/7307
+ /* eslint-disable valid-jsdoc */ //https://github.com/eslint/eslint/issues/7307
/**
* Sets the value for a setting. The room ID is optional if the setting is not being
* set for a particular room, otherwise it should be supplied. The value may be null
diff --git a/src/settings/controllers/SettingController.js b/src/settings/controllers/SettingController.js
index 0ebe0042e6..a7d0ccf21a 100644
--- a/src/settings/controllers/SettingController.js
+++ b/src/settings/controllers/SettingController.js
@@ -23,7 +23,6 @@ limitations under the License.
* intended to handle environmental factors for specific settings.
*/
export default class SettingController {
-
/**
* Gets the overridden value for the setting, if any. This must return null if the
* value is not to be overridden, otherwise it must return the new value.
diff --git a/src/stores/RoomListStore.js b/src/stores/RoomListStore.js
index 67c0c13be7..c670161dbc 100644
--- a/src/stores/RoomListStore.js
+++ b/src/stores/RoomListStore.js
@@ -23,7 +23,6 @@ import Unread from '../Unread';
* the RoomList.
*/
class RoomListStore extends Store {
-
static _listOrders = {
"m.favourite": "manual",
"im.vector.fake.invite": "recent",
diff --git a/src/utils/DMRoomMap.js b/src/utils/DMRoomMap.js
index bb5e4d706b..af65b6f001 100644
--- a/src/utils/DMRoomMap.js
+++ b/src/utils/DMRoomMap.js
@@ -93,7 +93,7 @@ export default class DMRoomMap {
return {userId, roomId};
}
}
- }).filter((ids) => !!ids); //filter out
+ }).filter((ids) => !!ids); //filter out
// these are actually all legit self-chats
// bail out
if (!guessedUserIdsThatChanged.length) {
diff --git a/src/utils/DecryptFile.js b/src/utils/DecryptFile.js
index 92c2e3644d..ea0e4c3fb0 100644
--- a/src/utils/DecryptFile.js
+++ b/src/utils/DecryptFile.js
@@ -77,7 +77,7 @@ const ALLOWED_BLOB_MIMETYPES = {
'audio/x-pn-wav': true,
'audio/flac': true,
'audio/x-flac': true,
-}
+};
/**
* Decrypt a file attached to a matrix event.