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

@ -86,7 +86,7 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
this.setMaxListeners(20); // RoomList + LeftPanel + 8xRoomSubList + spares
}
public async setTagSorting(tagId: TagID, sort: SortAlgorithm) {
public async setTagSorting(tagId: TagID, sort: SortAlgorithm): Promise<void> {
logger.info("SlidingRoomListStore.setTagSorting ", tagId, sort);
this.tagIdToSortAlgo[tagId] = sort;
const slidingSyncIndex = this.context.slidingSyncManager.getOrAllocateListIndex(tagId);
@ -122,7 +122,7 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
return this.counts[tagId] || 0;
}
public setListOrder(tagId: TagID, order: ListAlgorithm) {
public setListOrder(tagId: TagID, order: ListAlgorithm): void {
// TODO: https://github.com/vector-im/element-web/issues/23207
}
@ -187,7 +187,7 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
* @param {Room} room The room to update.
* @param {RoomUpdateCause} cause The cause to update for.
*/
public async manualRoomUpdate(room: Room, cause: RoomUpdateCause) {
public async manualRoomUpdate(room: Room, cause: RoomUpdateCause): Promise<void> {
// TODO: this is only used when you forget a room, not that important for now.
}
@ -202,7 +202,7 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
// no sticky room if you aren't viewing a room.
this.stickyRoomId = this.context.roomViewStore.getRoomId();
let stickyRoomNewIndex = -1;
const stickyRoomOldIndex = (tagMap[tagId] || []).findIndex((room) => {
const stickyRoomOldIndex = (tagMap[tagId] || []).findIndex((room): boolean => {
return room.roomId === this.stickyRoomId;
});
@ -258,7 +258,11 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
this.tagMap = tagMap;
}
private onSlidingSyncListUpdate(listIndex: number, joinCount: number, roomIndexToRoomId: Record<number, string>) {
private onSlidingSyncListUpdate(
listIndex: number,
joinCount: number,
roomIndexToRoomId: Record<number, string>,
): void {
const tagId = this.context.slidingSyncManager.listIdForIndex(listIndex);
this.counts[tagId] = joinCount;
this.refreshOrderedLists(tagId, roomIndexToRoomId);
@ -266,7 +270,7 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
this.emit(LISTS_UPDATE_EVENT);
}
private onRoomViewStoreUpdated() {
private onRoomViewStoreUpdated(): void {
// we only care about this to know when the user has clicked on a room to set the stickiness value
if (this.context.roomViewStore.getRoomId() === this.stickyRoomId) {
return;
@ -342,7 +346,7 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
});
}
private onSelectedSpaceUpdated = (activeSpace: SpaceKey, allRoomsInHome: boolean) => {
private onSelectedSpaceUpdated = (activeSpace: SpaceKey, allRoomsInHome: boolean): void => {
logger.info("SlidingRoomListStore.onSelectedSpaceUpdated", activeSpace);
// update the untagged filter
const tagId = DefaultTagID.Untagged;
@ -375,7 +379,7 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
};
// Intended for test usage
public async resetStore() {
public async resetStore(): Promise<void> {
// Test function
}
@ -387,7 +391,7 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
* @param trigger Set to false to prevent a list update from being sent. Should only
* be used if the calling code will manually trigger the update.
*/
public regenerateAllLists({ trigger = true }) {
public regenerateAllLists({ trigger = true }): void {
// Test function
}
@ -395,7 +399,7 @@ export class SlidingRoomListStoreClass extends AsyncStoreWithClient<IState> impl
await this.resetStore();
}
protected async onAction(payload: ActionPayload) {}
protected async onAction(payload: ActionPayload): Promise<void> {}
protected async onDispatchAsync(payload: ActionPayload) {}
protected async onDispatchAsync(payload: ActionPayload): Promise<void> {}
}