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

@ -127,7 +127,7 @@ function parseHeader(n: Node, pc: PartCreator, opts: IParseOptions): Part[] {
return [prefix, ...parseChildren(n, pc, opts)];
}
function checkIgnored(n) {
function checkIgnored(n: Node): boolean {
if (n.nodeType === Node.TEXT_NODE) {
// Element adds \n text nodes in a lot of places,
// which should be ignored
@ -138,7 +138,7 @@ function checkIgnored(n) {
return true;
}
function prefixLines(parts: Part[], prefix: string, pc: PartCreator) {
function prefixLines(parts: Part[], prefix: string, pc: PartCreator): void {
parts.unshift(pc.plain(prefix));
for (let i = 0; i < parts.length; i++) {
if (parts[i].type === Type.Newline) {
@ -283,7 +283,7 @@ export function parsePlainTextMessage(body: string, pc: PartCreator, opts: IPars
}, [] as Part[]);
}
export function parseEvent(event: MatrixEvent, pc: PartCreator, opts: IParseOptions = { shouldEscape: true }) {
export function parseEvent(event: MatrixEvent, pc: PartCreator, opts: IParseOptions = { shouldEscape: true }): Part[] {
const content = event.getContent();
let parts: Part[];
const isEmote = content.msgtype === MsgType.Emote;