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 {