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
|
@ -21,7 +21,7 @@ import { RoomType } from "matrix-js-sdk/src/@types/event";
|
|||
import { JoinRule, Preset, Visibility } from "matrix-js-sdk/src/@types/partials";
|
||||
|
||||
import SdkConfig from "../../../SdkConfig";
|
||||
import withValidation, { IFieldState } from "../elements/Validation";
|
||||
import withValidation, { IFieldState, IValidationResult } from "../elements/Validation";
|
||||
import { _t } from "../../../languageHandler";
|
||||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||
import { IOpts } from "../../../createRoom";
|
||||
|
@ -92,7 +92,7 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
|
|||
.then((isForced) => this.setState({ canChangeEncryption: !isForced }));
|
||||
}
|
||||
|
||||
private roomCreateOptions() {
|
||||
private roomCreateOptions(): IOpts {
|
||||
const opts: IOpts = {};
|
||||
const createOpts: IOpts["createOpts"] = (opts.createOpts = {});
|
||||
opts.roomType = this.props.type;
|
||||
|
@ -124,12 +124,12 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
|
|||
return opts;
|
||||
}
|
||||
|
||||
public componentDidMount() {
|
||||
public componentDidMount(): void {
|
||||
// move focus to first field when showing dialog
|
||||
this.nameField.current.focus();
|
||||
}
|
||||
|
||||
private onKeyDown = (event: KeyboardEvent) => {
|
||||
private onKeyDown = (event: KeyboardEvent): void => {
|
||||
const action = getKeyBindingsManager().getAccessibilityAction(event);
|
||||
switch (action) {
|
||||
case KeyBindingAction.Enter:
|
||||
|
@ -140,7 +140,7 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
|
|||
}
|
||||
};
|
||||
|
||||
private onOk = async () => {
|
||||
private onOk = async (): Promise<void> => {
|
||||
const activeElement = document.activeElement as HTMLElement;
|
||||
if (activeElement) {
|
||||
activeElement.blur();
|
||||
|
@ -168,39 +168,39 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
|
|||
}
|
||||
};
|
||||
|
||||
private onCancel = () => {
|
||||
private onCancel = (): void => {
|
||||
this.props.onFinished(false);
|
||||
};
|
||||
|
||||
private onNameChange = (ev: ChangeEvent<HTMLInputElement>) => {
|
||||
private onNameChange = (ev: ChangeEvent<HTMLInputElement>): void => {
|
||||
this.setState({ name: ev.target.value });
|
||||
};
|
||||
|
||||
private onTopicChange = (ev: ChangeEvent<HTMLInputElement>) => {
|
||||
private onTopicChange = (ev: ChangeEvent<HTMLInputElement>): void => {
|
||||
this.setState({ topic: ev.target.value });
|
||||
};
|
||||
|
||||
private onJoinRuleChange = (joinRule: JoinRule) => {
|
||||
private onJoinRuleChange = (joinRule: JoinRule): void => {
|
||||
this.setState({ joinRule });
|
||||
};
|
||||
|
||||
private onEncryptedChange = (isEncrypted: boolean) => {
|
||||
private onEncryptedChange = (isEncrypted: boolean): void => {
|
||||
this.setState({ isEncrypted });
|
||||
};
|
||||
|
||||
private onAliasChange = (alias: string) => {
|
||||
private onAliasChange = (alias: string): void => {
|
||||
this.setState({ alias });
|
||||
};
|
||||
|
||||
private onDetailsToggled = (ev: SyntheticEvent<HTMLDetailsElement>) => {
|
||||
private onDetailsToggled = (ev: SyntheticEvent<HTMLDetailsElement>): void => {
|
||||
this.setState({ detailsOpen: (ev.target as HTMLDetailsElement).open });
|
||||
};
|
||||
|
||||
private onNoFederateChange = (noFederate: boolean) => {
|
||||
private onNoFederateChange = (noFederate: boolean): void => {
|
||||
this.setState({ noFederate });
|
||||
};
|
||||
|
||||
private onNameValidate = async (fieldState: IFieldState) => {
|
||||
private onNameValidate = async (fieldState: IFieldState): Promise<IValidationResult> => {
|
||||
const result = await CreateRoomDialog.validateRoomName(fieldState);
|
||||
this.setState({ nameIsValid: result.valid });
|
||||
return result;
|
||||
|
@ -216,7 +216,7 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
|
|||
],
|
||||
});
|
||||
|
||||
public render() {
|
||||
public render(): JSX.Element {
|
||||
const isVideoRoom = this.props.type === RoomType.ElementVideo;
|
||||
|
||||
let aliasField: JSX.Element;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue