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
|
@ -14,7 +14,15 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React, { ComponentClass, createContext, forwardRef, useContext } from "react";
|
||||
import React, {
|
||||
ComponentClass,
|
||||
createContext,
|
||||
forwardRef,
|
||||
PropsWithoutRef,
|
||||
ForwardRefExoticComponent,
|
||||
useContext,
|
||||
RefAttributes,
|
||||
} from "react";
|
||||
import { MatrixClient } from "matrix-js-sdk/src/client";
|
||||
|
||||
const MatrixClientContext = createContext<MatrixClient>(undefined);
|
||||
|
@ -25,11 +33,16 @@ export interface MatrixClientProps {
|
|||
mxClient: MatrixClient;
|
||||
}
|
||||
|
||||
export function useMatrixClientContext() {
|
||||
export function useMatrixClientContext(): MatrixClient {
|
||||
return useContext(MatrixClientContext);
|
||||
}
|
||||
|
||||
const matrixHOC = <ComposedComponentProps extends {}>(ComposedComponent: ComponentClass<ComposedComponentProps>) => {
|
||||
const matrixHOC = <ComposedComponentProps extends {}>(
|
||||
ComposedComponent: ComponentClass<ComposedComponentProps>,
|
||||
): ForwardRefExoticComponent<
|
||||
PropsWithoutRef<Omit<ComposedComponentProps, "mxClient">> &
|
||||
RefAttributes<InstanceType<ComponentClass<ComposedComponentProps>>>
|
||||
> => {
|
||||
type ComposedComponentInstance = InstanceType<typeof ComposedComponent>;
|
||||
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
|
|
|
@ -68,6 +68,6 @@ const RoomContext = createContext<IRoomState>({
|
|||
});
|
||||
RoomContext.displayName = "RoomContext";
|
||||
export default RoomContext;
|
||||
export function useRoomContext() {
|
||||
export function useRoomContext(): IRoomState {
|
||||
return useContext(RoomContext);
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ export class SdkContextClass {
|
|||
* Automatically construct stores which need to be created eagerly so they can register with
|
||||
* the dispatcher.
|
||||
*/
|
||||
public constructEagerStores() {
|
||||
public constructEagerStores(): void {
|
||||
this._RoomViewStore = this.roomViewStore;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue