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:
Michael Telatynski 2023-01-12 13:25:14 +00:00 committed by GitHub
parent 7a36ba0fde
commit 030b7e90bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
683 changed files with 3459 additions and 3013 deletions

View file

@ -96,7 +96,7 @@ export default class MVideoBody extends React.PureComponent<IBodyProps, IState>
}
}
private loadBlurhash() {
private loadBlurhash(): void {
const info = this.props.mxEvent.getContent()?.info;
if (!info[BLURHASH_FIELD]) return;
@ -132,7 +132,7 @@ export default class MVideoBody extends React.PureComponent<IBodyProps, IState>
}
}
public async componentDidMount() {
public async componentDidMount(): Promise<void> {
this.sizeWatcher = SettingsStore.watchSetting("Images.size", null, () => {
this.forceUpdate(); // we don't really have a reliable thing to update, so just update the whole thing
});
@ -186,11 +186,11 @@ export default class MVideoBody extends React.PureComponent<IBodyProps, IState>
}
}
public componentWillUnmount() {
public componentWillUnmount(): void {
SettingsStore.unwatchSetting(this.sizeWatcher);
}
private videoOnPlay = async () => {
private videoOnPlay = async (): Promise<void> => {
if (this.hasContentUrl() || this.state.fetchingData || this.state.error) {
// We have the file, we are fetching the file, or there is an error.
return;
@ -227,12 +227,12 @@ export default class MVideoBody extends React.PureComponent<IBodyProps, IState>
);
}
private getFileBody = () => {
private getFileBody = (): JSX.Element => {
if (this.props.forExport) return null;
return this.showFileBody && <MFileBody {...this.props} showGenericPlaceholder={false} />;
};
public render() {
public render(): JSX.Element {
const content = this.props.mxEvent.getContent();
const autoplay = SettingsStore.getValue("autoplayVideo");