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

@ -15,7 +15,7 @@ limitations under the License.
*/
import { Room } from "matrix-js-sdk/src/models/room";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { IEvent, MatrixEvent } from "matrix-js-sdk/src/models/event";
import { EventType } from "matrix-js-sdk/src/@types/event";
import { logger } from "matrix-js-sdk/src/logger";
@ -60,7 +60,7 @@ export default class JSONExporter extends Exporter {
return JSON.stringify(jsonObject, null, 2);
}
protected async getJSONString(mxEv: MatrixEvent) {
protected async getJSONString(mxEv: MatrixEvent): Promise<IEvent> {
if (this.exportOptions.attachmentsIncluded && this.isAttachment(mxEv)) {
try {
const blob = await this.getMediaBlob(mxEv);
@ -81,7 +81,7 @@ export default class JSONExporter extends Exporter {
return clearEvent;
}
protected async createOutput(events: MatrixEvent[]) {
protected async createOutput(events: MatrixEvent[]): Promise<string> {
for (let i = 0; i < events.length; i++) {
const event = events[i];
this.updateProgress(
@ -99,7 +99,7 @@ export default class JSONExporter extends Exporter {
return this.createJSONString();
}
public async export() {
public async export(): Promise<void> {
logger.info("Starting export process...");
logger.info("Fetching events...");