Enforce explicit function return types

This re-enables the `@typescript-eslint/explicit-module-boundary-types`
check and also enables the
`@typescript-eslint/explicit-function-return-type` check.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-02-27 17:41:32 +01:00
parent 73db821649
commit 9fcc3c6cee
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
15 changed files with 59 additions and 42 deletions

View file

@ -123,7 +123,7 @@ export class AuthService {
return this.toAuthTokenWithSecretDto(createdToken, `${keyId}.${secret}`);
}
async setLastUsedToken(keyId: string) {
async setLastUsedToken(keyId: string): Promise<void> {
const accessToken = await this.authTokenRepository.findOne({
where: { keyId: keyId },
});
@ -166,7 +166,7 @@ export class AuthService {
return user.authTokens;
}
async removeToken(keyId: string) {
async removeToken(keyId: string): Promise<void> {
const token = await this.authTokenRepository.findOne({
where: { keyId: keyId },
});
@ -213,17 +213,17 @@ export class AuthService {
// Delete all non valid tokens every sunday on 3:00 AM
@Cron('0 0 3 * * 0')
async handleCron() {
async handleCron(): Promise<void> {
return await this.removeInvalidTokens();
}
// Delete all non valid tokens 5 sec after startup
@Timeout(5000)
async handleTimeout() {
async handleTimeout(): Promise<void> {
return await this.removeInvalidTokens();
}
async removeInvalidTokens() {
async removeInvalidTokens(): Promise<void> {
const currentTime = new Date().getTime();
const tokens: AuthToken[] = await this.authTokenRepository.find();
let removedTokens = 0;