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
|
@ -18,6 +18,7 @@ import React from "react";
|
|||
import { Room } from "matrix-js-sdk/src/models/room";
|
||||
import { RoomType, EventType } from "matrix-js-sdk/src/@types/event";
|
||||
import { JoinRule } from "matrix-js-sdk/src/@types/partials";
|
||||
import { ICreateRoomStateEvent } from "matrix-js-sdk/src/matrix";
|
||||
|
||||
import { calculateRoomVia } from "./permalinks/Permalinks";
|
||||
import Modal from "../Modal";
|
||||
|
@ -39,7 +40,7 @@ import { OpenSpaceSettingsPayload } from "../dispatcher/payloads/OpenSpaceSettin
|
|||
import { OpenAddExistingToSpaceDialogPayload } from "../dispatcher/payloads/OpenAddExistingToSpaceDialogPayload";
|
||||
import { SdkContextClass } from "../contexts/SDKContext";
|
||||
|
||||
export const shouldShowSpaceSettings = (space: Room) => {
|
||||
export const shouldShowSpaceSettings = (space: Room): boolean => {
|
||||
const userId = space.client.getUserId();
|
||||
return (
|
||||
space.getMyMembership() === "join" &&
|
||||
|
@ -50,7 +51,7 @@ export const shouldShowSpaceSettings = (space: Room) => {
|
|||
);
|
||||
};
|
||||
|
||||
export const makeSpaceParentEvent = (room: Room, canonical = false) => ({
|
||||
export const makeSpaceParentEvent = (room: Room, canonical = false): ICreateRoomStateEvent => ({
|
||||
type: EventType.SpaceParent,
|
||||
content: {
|
||||
via: calculateRoomVia(room),
|
||||
|
@ -59,7 +60,7 @@ export const makeSpaceParentEvent = (room: Room, canonical = false) => ({
|
|||
state_key: room.roomId,
|
||||
});
|
||||
|
||||
export function showSpaceSettings(space: Room) {
|
||||
export function showSpaceSettings(space: Room): void {
|
||||
defaultDispatcher.dispatch<OpenSpaceSettingsPayload>({
|
||||
action: Action.OpenSpaceSettings,
|
||||
space,
|
||||
|
@ -86,7 +87,7 @@ export const showCreateNewRoom = async (space: Room, type?: RoomType): Promise<b
|
|||
return shouldCreate;
|
||||
};
|
||||
|
||||
export const shouldShowSpaceInvite = (space: Room) =>
|
||||
export const shouldShowSpaceInvite = (space: Room): boolean =>
|
||||
((space?.getMyMembership() === "join" && space.canInvite(space.client.getUserId())) ||
|
||||
space.getJoinRule() === JoinRule.Public) &&
|
||||
shouldShowComponent(UIComponent.InviteUsers);
|
||||
|
@ -159,7 +160,7 @@ export const bulkSpaceBehaviour = async (
|
|||
}
|
||||
};
|
||||
|
||||
export const showSpacePreferences = (space: Room, initialTabId?: SpacePreferenceTab) => {
|
||||
export const showSpacePreferences = (space: Room, initialTabId?: SpacePreferenceTab): void => {
|
||||
defaultDispatcher.dispatch<OpenSpacePreferencesPayload>({
|
||||
action: Action.OpenSpacePreferences,
|
||||
space,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue