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
|
@ -25,7 +25,7 @@ import { THREAD_RELATION_TYPE } from "matrix-js-sdk/src/models/thread";
|
|||
import { _t } from "../../../languageHandler";
|
||||
import AccessibleTooltipButton from "../elements/AccessibleTooltipButton";
|
||||
import { CollapsibleButton } from "./CollapsibleButton";
|
||||
import { AboveLeftOf } from "../../structures/ContextMenu";
|
||||
import { MenuProps } from "../../structures/ContextMenu";
|
||||
import dis from "../../../dispatcher/dispatcher";
|
||||
import ErrorDialog from "../dialogs/ErrorDialog";
|
||||
import LocationButton from "../location/LocationButton";
|
||||
|
@ -46,7 +46,7 @@ interface IProps {
|
|||
haveRecording: boolean;
|
||||
isMenuOpen: boolean;
|
||||
isStickerPickerOpen: boolean;
|
||||
menuPosition?: AboveLeftOf;
|
||||
menuPosition?: MenuProps;
|
||||
onRecordStartEndClick: () => void;
|
||||
relation?: IEventRelation;
|
||||
setStickerPickerOpen: (isStickerPickerOpen: boolean) => void;
|
||||
|
@ -181,7 +181,7 @@ const UploadButtonContextProvider: React.FC<IUploadButtonProps> = ({ roomId, rel
|
|||
const roomContext = useContext(RoomContext);
|
||||
const uploadInput = useRef<HTMLInputElement>();
|
||||
|
||||
const onUploadClick = () => {
|
||||
const onUploadClick = (): void => {
|
||||
if (cli.isGuest()) {
|
||||
dis.dispatch({ action: "require_registration" });
|
||||
return;
|
||||
|
@ -195,7 +195,7 @@ const UploadButtonContextProvider: React.FC<IUploadButtonProps> = ({ roomId, rel
|
|||
}
|
||||
});
|
||||
|
||||
const onUploadFileInputChange = (ev: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const onUploadFileInputChange = (ev: React.ChangeEvent<HTMLInputElement>): void => {
|
||||
if (ev.target.files.length === 0) return;
|
||||
|
||||
// Take a copy, so we can safely reset the value of the form control
|
||||
|
@ -232,11 +232,11 @@ const UploadButtonContextProvider: React.FC<IUploadButtonProps> = ({ roomId, rel
|
|||
};
|
||||
|
||||
// Must be rendered within an UploadButtonContextProvider
|
||||
const UploadButton = () => {
|
||||
const UploadButton: React.FC = () => {
|
||||
const overflowMenuCloser = useContext(OverflowMenuContext);
|
||||
const uploadButtonFn = useContext(UploadButtonContext);
|
||||
|
||||
const onClick = () => {
|
||||
const onClick = (): void => {
|
||||
uploadButtonFn?.();
|
||||
overflowMenuCloser?.(); // close overflow menu
|
||||
};
|
||||
|
@ -302,7 +302,7 @@ class PollButton extends React.PureComponent<IPollButtonProps> {
|
|||
public static contextType = OverflowMenuContext;
|
||||
public context!: React.ContextType<typeof OverflowMenuContext>;
|
||||
|
||||
private onCreateClick = () => {
|
||||
private onCreateClick = (): void => {
|
||||
this.context?.(); // close overflow menu
|
||||
const canSend = this.props.room.currentState.maySendEvent(
|
||||
M_POLL_START.name,
|
||||
|
@ -330,7 +330,7 @@ class PollButton extends React.PureComponent<IPollButtonProps> {
|
|||
}
|
||||
};
|
||||
|
||||
public render() {
|
||||
public render(): JSX.Element {
|
||||
// do not allow sending polls within threads at this time
|
||||
if (this.props.relation?.rel_type === THREAD_RELATION_TYPE.name) return null;
|
||||
|
||||
|
@ -369,7 +369,7 @@ interface WysiwygToggleButtonProps {
|
|||
onClick: MouseEventHandler<HTMLDivElement>;
|
||||
}
|
||||
|
||||
function ComposerModeButton({ isRichTextEnabled, onClick }: WysiwygToggleButtonProps) {
|
||||
function ComposerModeButton({ isRichTextEnabled, onClick }: WysiwygToggleButtonProps): JSX.Element {
|
||||
const title = isRichTextEnabled ? _t("Hide formatting") : _t("Show formatting");
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue