From 05d030908169bf14c4095600d41a01c186e6c954 Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Thu, 18 Jun 2020 14:32:43 +0100 Subject: [PATCH 1/3] Lint a few semicolons --- src/@types/common.ts | 2 +- src/BasePlatform.ts | 2 +- src/DeviceListener.ts | 14 ++++---- src/MatrixClientPeg.ts | 14 ++++---- src/actions/TagOrderActions.ts | 2 +- src/autocomplete/Autocompleter.ts | 10 +++--- src/autocomplete/Components.tsx | 2 +- src/components/structures/MatrixChat.tsx | 4 +-- src/components/structures/UserMenuButton.tsx | 2 +- src/components/views/auth/PassphraseField.tsx | 2 +- .../views/elements/AccessibleButton.tsx | 4 +-- src/components/views/elements/Draggable.tsx | 22 ++++++------- src/components/views/elements/Field.tsx | 12 +++---- .../elements/IRCTimelineProfileResizer.tsx | 33 ++++++++++--------- .../views/elements/SettingsFlag.tsx | 8 ++--- src/components/views/elements/Slider.tsx | 16 ++++----- .../views/elements/StyledCheckbox.tsx | 4 +-- .../views/elements/StyledRadioButton.tsx | 4 +-- .../views/elements/ToggleSwitch.tsx | 2 +- src/components/views/elements/Tooltip.tsx | 10 +++--- .../views/rooms/RoomBreadcrumbs2.tsx | 2 +- src/components/views/rooms/RoomSublist2.tsx | 2 +- src/components/views/rooms/RoomTile2.tsx | 2 +- .../tabs/user/AppearanceUserSettingsTab.tsx | 20 +++++------ .../views/toasts/VerificationRequestToast.tsx | 2 +- .../payloads/CheckUpdatesPayload.ts | 2 +- src/dispatcher/payloads/OpenToTabPayload.ts | 2 +- .../payloads/RecheckThemePayload.ts | 2 +- src/dispatcher/payloads/ViewTooltipPayload.ts | 4 +-- src/dispatcher/payloads/ViewUserPayload.ts | 2 +- src/settings/watchers/Watcher.ts | 4 +-- src/stores/room-list/algorithms/Algorithm.ts | 4 +-- src/utils/FormattingUtils.ts | 2 +- src/utils/ShieldUtils.ts | 2 +- tslint.json | 4 ++- 35 files changed, 115 insertions(+), 110 deletions(-) diff --git a/src/@types/common.ts b/src/@types/common.ts index 26e5317aa3..9109993541 100644 --- a/src/@types/common.ts +++ b/src/@types/common.ts @@ -15,5 +15,5 @@ limitations under the License. */ // Based on https://stackoverflow.com/a/53229857/3532235 -export type Without = {[P in Exclude] ? : never} +export type Without = {[P in Exclude] ? : never}; export type XOR = (T | U) extends object ? (Without & U) | (Without & T) : T | U; diff --git a/src/BasePlatform.ts b/src/BasePlatform.ts index 520c3fbe46..d54dc7dd23 100644 --- a/src/BasePlatform.ts +++ b/src/BasePlatform.ts @@ -150,7 +150,7 @@ export default abstract class BasePlatform { abstract displayNotification(title: string, msg: string, avatarUrl: string, room: Object); loudNotification(ev: Event, room: Object) { - }; + } /** * Returns a promise that resolves to a string representing the current version of the application. diff --git a/src/DeviceListener.ts b/src/DeviceListener.ts index e73b56416b..cfec2890d2 100644 --- a/src/DeviceListener.ts +++ b/src/DeviceListener.ts @@ -119,26 +119,26 @@ export default class DeviceListener { // No need to do a recheck here: we just need to get a snapshot of our devices // before we download any new ones. - } + }; _onDevicesUpdated = (users: string[]) => { if (!users.includes(MatrixClientPeg.get().getUserId())) return; this._recheck(); - } + }; _onDeviceVerificationChanged = (userId: string) => { if (userId !== MatrixClientPeg.get().getUserId()) return; this._recheck(); - } + }; _onUserTrustStatusChanged = (userId: string) => { if (userId !== MatrixClientPeg.get().getUserId()) return; this._recheck(); - } + }; _onCrossSingingKeysChanged = () => { this._recheck(); - } + }; _onAccountData = (ev) => { // User may have: @@ -152,11 +152,11 @@ export default class DeviceListener { ) { this._recheck(); } - } + }; _onSync = (state, prevState) => { if (state === 'PREPARED' && prevState === null) this._recheck(); - } + }; // The server doesn't tell us when key backup is set up, so we poll // & cache the result diff --git a/src/MatrixClientPeg.ts b/src/MatrixClientPeg.ts index bc550c1935..5f334a639c 100644 --- a/src/MatrixClientPeg.ts +++ b/src/MatrixClientPeg.ts @@ -35,13 +35,13 @@ import { crossSigningCallbacks } from './CrossSigningManager'; import {SHOW_QR_CODE_METHOD} from "matrix-js-sdk/src/crypto/verification/QRCode"; export interface IMatrixClientCreds { - homeserverUrl: string, - identityServerUrl: string, - userId: string, - deviceId: string, - accessToken: string, - guest: boolean, - pickleKey?: string, + homeserverUrl: string; + identityServerUrl: string; + userId: string; + deviceId: string; + accessToken: string; + guest: boolean; + pickleKey?: string; } // TODO: Move this to the js-sdk diff --git a/src/actions/TagOrderActions.ts b/src/actions/TagOrderActions.ts index bf1820d5d1..75097952c0 100644 --- a/src/actions/TagOrderActions.ts +++ b/src/actions/TagOrderActions.ts @@ -60,7 +60,7 @@ export default class TagOrderActions { // For an optimistic update return {tags, removedTags}; }); - }; + } /** * Creates an action thunk that will do an asynchronous request to diff --git a/src/autocomplete/Autocompleter.ts b/src/autocomplete/Autocompleter.ts index 8384eb9d4f..2615736e09 100644 --- a/src/autocomplete/Autocompleter.ts +++ b/src/autocomplete/Autocompleter.ts @@ -35,15 +35,15 @@ export interface ISelectionRange { export interface ICompletion { type: "at-room" | "command" | "community" | "room" | "user"; - completion: string, + completion: string; completionId?: string; - component?: ReactElement, - range: ISelectionRange, - command?: string, + component?: ReactElement; + range: ISelectionRange; + command?: string; suffix?: string; // If provided, apply a LINK entity to the completion with the // data = { url: href }. - href?: string, + href?: string; } const PROVIDERS = [ diff --git a/src/autocomplete/Components.tsx b/src/autocomplete/Components.tsx index 0ee0088f02..6ac2f4db14 100644 --- a/src/autocomplete/Components.tsx +++ b/src/autocomplete/Components.tsx @@ -46,7 +46,7 @@ export const TextualCompletion = forwardRef((props }); interface IPillCompletionProps extends ITextualCompletionProps { - children?: React.ReactNode, + children?: React.ReactNode; } export const PillCompletion = forwardRef((props, ref) => { diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 634e13b103..d5f73fa3df 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -151,9 +151,9 @@ interface IProps { // TODO type things better // Represents the screen to display as a result of parsing the initial window.location initialScreenAfterLogin?: IScreen; // displayname, if any, to set on the device when logging in/registering. - defaultDeviceDisplayName?: string, + defaultDeviceDisplayName?: string; // A function that makes a registration URL - makeRegistrationUrl: (object) => string, + makeRegistrationUrl: (object) => string; } interface IState { diff --git a/src/components/structures/UserMenuButton.tsx b/src/components/structures/UserMenuButton.tsx index f3626ba270..6607fffdd1 100644 --- a/src/components/structures/UserMenuButton.tsx +++ b/src/components/structures/UserMenuButton.tsx @@ -291,6 +291,6 @@ export default class UserMenuButton extends React.Component { {contextMenu} - ) + ); } } diff --git a/src/components/views/auth/PassphraseField.tsx b/src/components/views/auth/PassphraseField.tsx index f09791ce26..2f5064447e 100644 --- a/src/components/views/auth/PassphraseField.tsx +++ b/src/components/views/auth/PassphraseField.tsx @@ -118,7 +118,7 @@ class PassphraseField extends PureComponent { value={this.props.value} onChange={this.props.onChange} onValidate={this.onValidate} - /> + />; } } diff --git a/src/components/views/elements/AccessibleButton.tsx b/src/components/views/elements/AccessibleButton.tsx index 18dd43ad02..01a27d9522 100644 --- a/src/components/views/elements/AccessibleButton.tsx +++ b/src/components/views/elements/AccessibleButton.tsx @@ -19,7 +19,7 @@ import React from 'react'; import {Key} from '../../../Keyboard'; import classnames from 'classnames'; -export type ButtonEvent = React.MouseEvent | React.KeyboardEvent +export type ButtonEvent = React.MouseEvent | React.KeyboardEvent; /** * children: React's magic prop. Represents all children given to the element. @@ -40,7 +40,7 @@ interface IProps extends React.InputHTMLAttributes { disabled?: boolean; className?: string; onClick?(e?: ButtonEvent): void; -}; +} interface IAccessibleButtonProps extends React.InputHTMLAttributes { ref?: React.Ref; diff --git a/src/components/views/elements/Draggable.tsx b/src/components/views/elements/Draggable.tsx index 3096ac42f7..3397fd901c 100644 --- a/src/components/views/elements/Draggable.tsx +++ b/src/components/views/elements/Draggable.tsx @@ -17,20 +17,20 @@ limitations under the License. import React from 'react'; interface IProps { - className: string, - dragFunc: (currentLocation: ILocationState, event: MouseEvent) => ILocationState, - onMouseUp: (event: MouseEvent) => void, + className: string; + dragFunc: (currentLocation: ILocationState, event: MouseEvent) => ILocationState; + onMouseUp: (event: MouseEvent) => void; } interface IState { - onMouseMove: (event: MouseEvent) => void, - onMouseUp: (event: MouseEvent) => void, - location: ILocationState, + onMouseMove: (event: MouseEvent) => void; + onMouseUp: (event: MouseEvent) => void; + location: ILocationState; } export interface ILocationState { - currentX: number, - currentY: number, + currentX: number; + currentY: number; } export default class Draggable extends React.Component { @@ -58,13 +58,13 @@ export default class Draggable extends React.Component { document.addEventListener("mousemove", this.state.onMouseMove); document.addEventListener("mouseup", this.state.onMouseUp); - } + }; private onMouseUp = (event: MouseEvent): void => { document.removeEventListener("mousemove", this.state.onMouseMove); document.removeEventListener("mouseup", this.state.onMouseUp); this.props.onMouseUp(event); - } + }; private onMouseMove(event: MouseEvent): void { const newLocation = this.props.dragFunc(this.state.location, event); @@ -75,7 +75,7 @@ export default class Draggable extends React.Component { } render() { - return
+ return
; } } \ No newline at end of file diff --git a/src/components/views/elements/Field.tsx b/src/components/views/elements/Field.tsx index 63bdce3e3b..fbee431d6e 100644 --- a/src/components/views/elements/Field.tsx +++ b/src/components/views/elements/Field.tsx @@ -85,20 +85,20 @@ interface ITextareaProps extends IProps, TextareaHTMLAttributes { private id: string; private input: HTMLInputElement; - private static defaultProps = { + public static readonly defaultProps = { element: "input", type: "text", - } + }; /* * This was changed from throttle to debounce: this is more traditional for diff --git a/src/components/views/elements/IRCTimelineProfileResizer.tsx b/src/components/views/elements/IRCTimelineProfileResizer.tsx index 596d46bf36..65140707d5 100644 --- a/src/components/views/elements/IRCTimelineProfileResizer.tsx +++ b/src/components/views/elements/IRCTimelineProfileResizer.tsx @@ -20,15 +20,15 @@ import Draggable, {ILocationState} from './Draggable'; interface IProps { // Current room - roomId: string, - minWidth: number, - maxWidth: number, -}; + roomId: string; + minWidth: number; + maxWidth: number; +} interface IState { - width: number, - IRCLayoutRoot: HTMLElement, -}; + width: number; + IRCLayoutRoot: HTMLElement; +} export default class IRCTimelineProfileResizer extends React.Component { constructor(props: IProps) { @@ -37,20 +37,19 @@ export default class IRCTimelineProfileResizer extends React.Component this.updateCSSWidth(this.state.width)) + }, () => this.updateCSSWidth(this.state.width)); } private dragFunc = (location: ILocationState, event: React.MouseEvent): ILocationState => { const offset = event.clientX - location.currentX; const newWidth = this.state.width + offset; - console.log({offset}) // If we're trying to go smaller than min width, don't. if (newWidth < this.props.minWidth) { return location; @@ -69,8 +68,8 @@ export default class IRCTimelineProfileResizer extends React.Component + return ; } -}; \ No newline at end of file +} diff --git a/src/components/views/elements/SettingsFlag.tsx b/src/components/views/elements/SettingsFlag.tsx index bda15ebaab..9bdd04d803 100644 --- a/src/components/views/elements/SettingsFlag.tsx +++ b/src/components/views/elements/SettingsFlag.tsx @@ -48,18 +48,18 @@ export default class SettingsFlag extends React.Component { this.props.roomId, this.props.isExplicit, ), - } + }; } private onChange = (checked: boolean): void => { this.save(checked); this.setState({ value: checked }); if (this.props.onChange) this.props.onChange(checked); - } + }; private checkBoxOnChange = (e: React.ChangeEvent) => { this.onChange(e.target.checked); - } + }; private save = (val?: boolean): void => { return SettingsStore.setValue( @@ -68,7 +68,7 @@ export default class SettingsFlag extends React.Component { this.props.level, val !== undefined ? val : this.state.value, ); - } + }; public render() { const canChange = SettingsStore.canSetValue(this.props.name, this.props.roomId, this.props.level); diff --git a/src/components/views/elements/Slider.tsx b/src/components/views/elements/Slider.tsx index f76a4684d3..7c4b09568a 100644 --- a/src/components/views/elements/Slider.tsx +++ b/src/components/views/elements/Slider.tsx @@ -65,9 +65,9 @@ export default class Slider extends React.Component { const intervalWidth = 1 / (values.length - 1); - const linearInterpolation = (value - closestLessValue) / (closestGreaterValue - closestLessValue) + const linearInterpolation = (value - closestLessValue) / (closestGreaterValue - closestLessValue); - return 100 * (closest - 1 + linearInterpolation) * intervalWidth + return 100 * (closest - 1 + linearInterpolation) * intervalWidth; } @@ -86,8 +86,8 @@ export default class Slider extends React.Component { const offset = this.offset(this.props.values, this.props.value); selection =
-
-
+
+
; } return
@@ -115,13 +115,13 @@ export default class Slider extends React.Component { interface IDotProps { // Callback for behavior onclick - onClick: () => void, + onClick: () => void; // Whether the dot should appear active - active: boolean, + active: boolean; // The label on the dot - label: string, + label: string; // Whether the slider is disabled disabled: boolean; @@ -129,7 +129,7 @@ interface IDotProps { class Dot extends React.PureComponent { render(): React.ReactNode { - let className = "mx_Slider_dot" + let className = "mx_Slider_dot"; if (!this.props.disabled && this.props.active) { className += " mx_Slider_dotActive"; } diff --git a/src/components/views/elements/StyledCheckbox.tsx b/src/components/views/elements/StyledCheckbox.tsx index 341f59d5da..be983828ff 100644 --- a/src/components/views/elements/StyledCheckbox.tsx +++ b/src/components/views/elements/StyledCheckbox.tsx @@ -30,7 +30,7 @@ export default class StyledCheckbox extends React.PureComponent public static readonly defaultProps = { className: "", - } + }; constructor(props: IProps) { super(props); @@ -51,6 +51,6 @@ export default class StyledCheckbox extends React.PureComponent { this.props.children }
- + ; } } \ No newline at end of file diff --git a/src/components/views/elements/StyledRadioButton.tsx b/src/components/views/elements/StyledRadioButton.tsx index fdedd16230..0ea786d953 100644 --- a/src/components/views/elements/StyledRadioButton.tsx +++ b/src/components/views/elements/StyledRadioButton.tsx @@ -26,7 +26,7 @@ interface IState { export default class StyledRadioButton extends React.PureComponent { public static readonly defaultProps = { className: '', - } + }; public render() { const { children, className, disabled, ...otherProps } = this.props; @@ -43,6 +43,6 @@ export default class StyledRadioButton extends React.PureComponent
{children}
- + ; } } diff --git a/src/components/views/elements/ToggleSwitch.tsx b/src/components/views/elements/ToggleSwitch.tsx index 7b690899ac..f05c45b3db 100644 --- a/src/components/views/elements/ToggleSwitch.tsx +++ b/src/components/views/elements/ToggleSwitch.tsx @@ -28,7 +28,7 @@ interface IProps { // Called when the checked state changes. First argument will be the new state. onChange(checked: boolean): void; -}; +} // Controlled Toggle Switch element, written with Accessibility in mind export default ({checked, disabled = false, onChange, ...props}: IProps) => { diff --git a/src/components/views/elements/Tooltip.tsx b/src/components/views/elements/Tooltip.tsx index 38960d1a58..69ad5e256c 100644 --- a/src/components/views/elements/Tooltip.tsx +++ b/src/components/views/elements/Tooltip.tsx @@ -29,15 +29,15 @@ const MIN_TOOLTIP_HEIGHT = 25; interface IProps { // Class applied to the element used to position the tooltip - className: string, + className: string; // Class applied to the tooltip itself - tooltipClassName?: string, + tooltipClassName?: string; // Whether the tooltip is visible or hidden. // The hidden state allows animating the tooltip away via CSS. // Defaults to visible if unset. - visible?: boolean, + visible?: boolean; // the react element to put into the tooltip - label: React.ReactNode, + label: React.ReactNode; } export default class Tooltip extends React.Component { @@ -126,7 +126,7 @@ export default class Tooltip extends React.Component { tooltip: this.tooltip, parent: parent, }); - } + }; public render() { // Render a placeholder diff --git a/src/components/views/rooms/RoomBreadcrumbs2.tsx b/src/components/views/rooms/RoomBreadcrumbs2.tsx index 1b912b39d6..69cca39d9f 100644 --- a/src/components/views/rooms/RoomBreadcrumbs2.tsx +++ b/src/components/views/rooms/RoomBreadcrumbs2.tsx @@ -97,7 +97,7 @@ export default class RoomBreadcrumbs2 extends React.PureComponent - ) + ); }); if (tiles.length > 0) { diff --git a/src/components/views/rooms/RoomSublist2.tsx b/src/components/views/rooms/RoomSublist2.tsx index c72e74a1be..bfa210ebf9 100644 --- a/src/components/views/rooms/RoomSublist2.tsx +++ b/src/components/views/rooms/RoomSublist2.tsx @@ -420,7 +420,7 @@ export default class RoomSublist2 extends React.Component { {visibleTiles} {showNButton} - ) + ); } // TODO: onKeyDown support diff --git a/src/components/views/rooms/RoomTile2.tsx b/src/components/views/rooms/RoomTile2.tsx index 671b981ac5..9f4870d437 100644 --- a/src/components/views/rooms/RoomTile2.tsx +++ b/src/components/views/rooms/RoomTile2.tsx @@ -232,7 +232,7 @@ export default class RoomTile2 extends React.Component { /> {contextMenu} - ) + ); } public render(): React.ReactElement { diff --git a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx index fe575c2819..7867852c1d 100644 --- a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx @@ -35,23 +35,23 @@ interface IProps { } interface IThemeState { - theme: string, - useSystemTheme: boolean, + theme: string; + useSystemTheme: boolean; } export interface CustomThemeMessage { - isError: boolean, - text: string -}; + isError: boolean; + text: string; +} interface IState extends IThemeState { // String displaying the current selected fontSize. // Needs to be string for things like '17.' without // trailing 0s. - fontSize: string, - customThemeUrl: string, - customThemeMessage: CustomThemeMessage, - useCustomFontSize: boolean, + fontSize: string; + customThemeUrl: string; + customThemeMessage: CustomThemeMessage; + useCustomFontSize: boolean; } export default class AppearanceUserSettingsTab extends React.Component { @@ -159,7 +159,7 @@ export default class AppearanceUserSettingsTab extends React.Component => { let currentThemes: string[] = SettingsStore.getValue("custom_themes"); diff --git a/src/components/views/toasts/VerificationRequestToast.tsx b/src/components/views/toasts/VerificationRequestToast.tsx index 38e7e31989..cc41e81b33 100644 --- a/src/components/views/toasts/VerificationRequestToast.tsx +++ b/src/components/views/toasts/VerificationRequestToast.tsx @@ -90,7 +90,7 @@ export default class VerificationRequestToast extends React.PureComponent { ToastStore.sharedInstance().dismissToast(this.props.toastKey); diff --git a/src/dispatcher/payloads/CheckUpdatesPayload.ts b/src/dispatcher/payloads/CheckUpdatesPayload.ts index 0f0f9a01e5..fa4fb3a538 100644 --- a/src/dispatcher/payloads/CheckUpdatesPayload.ts +++ b/src/dispatcher/payloads/CheckUpdatesPayload.ts @@ -19,7 +19,7 @@ import { Action } from "../actions"; import {UpdateCheckStatus} from "../../BasePlatform"; export interface CheckUpdatesPayload extends ActionPayload { - action: Action.CheckUpdates, + action: Action.CheckUpdates; /** * The current phase of the manual update check. diff --git a/src/dispatcher/payloads/OpenToTabPayload.ts b/src/dispatcher/payloads/OpenToTabPayload.ts index 2877ee053e..7548c342e4 100644 --- a/src/dispatcher/payloads/OpenToTabPayload.ts +++ b/src/dispatcher/payloads/OpenToTabPayload.ts @@ -18,7 +18,7 @@ import { ActionPayload } from "../payloads"; import { Action } from "../actions"; export interface OpenToTabPayload extends ActionPayload { - action: Action.ViewUserSettings | string, // TODO: Add room settings action + action: Action.ViewUserSettings | string; // TODO: Add room settings action /** * The tab ID to open in the settings view to start, if possible. diff --git a/src/dispatcher/payloads/RecheckThemePayload.ts b/src/dispatcher/payloads/RecheckThemePayload.ts index 06f7012049..e9bea612e0 100644 --- a/src/dispatcher/payloads/RecheckThemePayload.ts +++ b/src/dispatcher/payloads/RecheckThemePayload.ts @@ -18,7 +18,7 @@ import { ActionPayload } from "../payloads"; import { Action } from "../actions"; export interface RecheckThemePayload extends ActionPayload { - action: Action.RecheckTheme, + action: Action.RecheckTheme; /** * Optionally specify the exact theme which is to be loaded. diff --git a/src/dispatcher/payloads/ViewTooltipPayload.ts b/src/dispatcher/payloads/ViewTooltipPayload.ts index 8778287128..069e3a619a 100644 --- a/src/dispatcher/payloads/ViewTooltipPayload.ts +++ b/src/dispatcher/payloads/ViewTooltipPayload.ts @@ -19,7 +19,7 @@ import { Action } from "../actions"; import { Component } from "react"; export interface ViewTooltipPayload extends ActionPayload { - action: Action.ViewTooltip, + action: Action.ViewTooltip; /* * The tooltip to render. If it's null the tooltip will not be rendered @@ -31,5 +31,5 @@ export interface ViewTooltipPayload extends ActionPayload { * The parent under which to render the tooltip. Can be null to remove * the parent type. */ - parent: null | Element + parent: null | Element; } \ No newline at end of file diff --git a/src/dispatcher/payloads/ViewUserPayload.ts b/src/dispatcher/payloads/ViewUserPayload.ts index ed602d4e24..c2838d0dbb 100644 --- a/src/dispatcher/payloads/ViewUserPayload.ts +++ b/src/dispatcher/payloads/ViewUserPayload.ts @@ -19,7 +19,7 @@ import { ActionPayload } from "../payloads"; import { Action } from "../actions"; export interface ViewUserPayload extends ActionPayload { - action: Action.ViewUser, + action: Action.ViewUser; /** * The member to view. May be null or falsy to indicate that no member diff --git a/src/settings/watchers/Watcher.ts b/src/settings/watchers/Watcher.ts index a9f6f3f2c8..94a14faa27 100644 --- a/src/settings/watchers/Watcher.ts +++ b/src/settings/watchers/Watcher.ts @@ -15,6 +15,6 @@ limitations under the License. */ export default interface IWatcher { - start(): void - stop(): void + start(): void; + stop(): void; } \ No newline at end of file diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts index a89167095d..d145149cc7 100644 --- a/src/stores/room-list/algorithms/Algorithm.ts +++ b/src/stores/room-list/algorithms/Algorithm.ts @@ -127,7 +127,7 @@ export class Algorithm extends EventEmitter { const algorithm = getListAlgorithmInstance(order, tagId, this.sortAlgorithms[tagId]); this.algorithms[tagId] = algorithm; - await algorithm.setRooms(this._cachedRooms[tagId]) + await algorithm.setRooms(this._cachedRooms[tagId]); this._cachedRooms[tagId] = algorithm.orderedRooms; this.recalculateFilteredRoomsForTag(tagId); // update filter to re-sort the list this.recalculateStickyRoom(tagId); // update sticky room to make sure it appears if needed @@ -541,5 +541,5 @@ export class Algorithm extends EventEmitter { } return true; - }; + } } diff --git a/src/utils/FormattingUtils.ts b/src/utils/FormattingUtils.ts index 21b50da4ca..f82500de71 100644 --- a/src/utils/FormattingUtils.ts +++ b/src/utils/FormattingUtils.ts @@ -36,7 +36,7 @@ export function formatCount(count: number): string { */ export function formatCountLong(count: number): string { const formatter = new Intl.NumberFormat(); - return formatter.format(count) + return formatter.format(count); } /** diff --git a/src/utils/ShieldUtils.ts b/src/utils/ShieldUtils.ts index adaa961a00..3f8cf06815 100644 --- a/src/utils/ShieldUtils.ts +++ b/src/utils/ShieldUtils.ts @@ -10,7 +10,7 @@ interface Client { getStoredDevicesForUser: (userId: string) => [{ deviceId: string }]; checkDeviceTrust: (userId: string, deviceId: string) => { isVerified: () => boolean - } + }; } interface Room { diff --git a/tslint.json b/tslint.json index fc234117fc..fd99d9d228 100644 --- a/tslint.json +++ b/tslint.json @@ -46,7 +46,9 @@ "quotemark": false, "radix": true, "semicolon": [ - "always" + true, + "always", + "strict-bound-class-methods" ], "triple-equals": [], "typedef-whitespace": [ From 74174041bb9de8e0e2246db61e810e172d6c3ef8 Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Thu, 18 Jun 2020 14:53:12 +0100 Subject: [PATCH 2/3] Remove semicolon in style --- src/components/views/elements/Slider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/elements/Slider.tsx b/src/components/views/elements/Slider.tsx index 7c4b09568a..a88c581d07 100644 --- a/src/components/views/elements/Slider.tsx +++ b/src/components/views/elements/Slider.tsx @@ -86,7 +86,7 @@ export default class Slider extends React.Component { const offset = this.offset(this.props.values, this.props.value); selection =
-
+
; } From ba0bc8f29ccec1c2b7c71dd98f46c0bce317305b Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Thu, 18 Jun 2020 14:55:24 +0100 Subject: [PATCH 3/3] Resolve "The Great Conflict" --- .../room-list/algorithms/list-ordering/ImportanceAlgorithm.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts b/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts index 6e09b0f8d3..15fa00c302 100644 --- a/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts +++ b/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts @@ -270,7 +270,7 @@ export class ImportanceAlgorithm extends OrderingAlgorithm { // handling. For instance, if 45 rooms are removed from the middle of a 50 room list, the // index for the categories will be way off. - const nextOrderIndex = CATEGORY_ORDER.indexOf(category) + 1 + const nextOrderIndex = CATEGORY_ORDER.indexOf(category) + 1; if (n > 0) { for (let i = nextOrderIndex; i < CATEGORY_ORDER.length; i++) { const nextCategory = CATEGORY_ORDER[i];