Enable @typescript-eslint/explicit-function-return-type
in /src (#9788)
* Enable `@typescript-eslint/explicit-member-accessibility` on /src * Prettier * Enable `@typescript-eslint/explicit-function-return-type` in /src * Fix types * tsc strict fixes * Delint * Fix test * Fix bad merge
This commit is contained in:
parent
7a36ba0fde
commit
030b7e90bf
683 changed files with 3459 additions and 3013 deletions
|
@ -38,7 +38,7 @@ const GenericExpiringToast: React.FC<IProps> = ({
|
|||
toastKey,
|
||||
numSeconds,
|
||||
}) => {
|
||||
const onReject = () => {
|
||||
const onReject = (): void => {
|
||||
if (onDismiss) onDismiss();
|
||||
ToastStore.sharedInstance().dismissToast(toastKey);
|
||||
};
|
||||
|
|
|
@ -22,11 +22,11 @@ import Modal from "../../../Modal";
|
|||
import ServerOfflineDialog from "../dialogs/ServerOfflineDialog";
|
||||
|
||||
export default class NonUrgentEchoFailureToast extends React.PureComponent {
|
||||
private openDialog = () => {
|
||||
private openDialog = (): void => {
|
||||
Modal.createDialog(ServerOfflineDialog, {});
|
||||
};
|
||||
|
||||
public render() {
|
||||
public render(): JSX.Element {
|
||||
return (
|
||||
<div className="mx_NonUrgentEchoFailureToast">
|
||||
<span className="mx_NonUrgentEchoFailureToast_icon" />
|
||||
|
|
|
@ -54,7 +54,7 @@ export default class VerificationRequestToast extends React.PureComponent<IProps
|
|||
this.state = { counter: Math.ceil(props.request.timeout / 1000) };
|
||||
}
|
||||
|
||||
public async componentDidMount() {
|
||||
public async componentDidMount(): Promise<void> {
|
||||
const { request } = this.props;
|
||||
if (request.timeout && request.timeout > 0) {
|
||||
this.intervalHandle = window.setInterval(() => {
|
||||
|
@ -83,20 +83,20 @@ export default class VerificationRequestToast extends React.PureComponent<IProps
|
|||
}
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
public componentWillUnmount(): void {
|
||||
clearInterval(this.intervalHandle);
|
||||
const { request } = this.props;
|
||||
request.off(VerificationRequestEvent.Change, this.checkRequestIsPending);
|
||||
}
|
||||
|
||||
private checkRequestIsPending = () => {
|
||||
private checkRequestIsPending = (): void => {
|
||||
const { request } = this.props;
|
||||
if (!request.canAccept) {
|
||||
ToastStore.sharedInstance().dismissToast(this.props.toastKey);
|
||||
}
|
||||
};
|
||||
|
||||
public cancel = () => {
|
||||
public cancel = (): void => {
|
||||
ToastStore.sharedInstance().dismissToast(this.props.toastKey);
|
||||
try {
|
||||
this.props.request.cancel();
|
||||
|
@ -105,7 +105,7 @@ export default class VerificationRequestToast extends React.PureComponent<IProps
|
|||
}
|
||||
};
|
||||
|
||||
public accept = async () => {
|
||||
public accept = async (): Promise<void> => {
|
||||
ToastStore.sharedInstance().dismissToast(this.props.toastKey);
|
||||
const { request } = this.props;
|
||||
// no room id for to_device requests
|
||||
|
@ -148,7 +148,7 @@ export default class VerificationRequestToast extends React.PureComponent<IProps
|
|||
}
|
||||
};
|
||||
|
||||
public render() {
|
||||
public render(): JSX.Element {
|
||||
const { request } = this.props;
|
||||
let description;
|
||||
let detail;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue