chore: suit eslint rules

This commit is contained in:
Ali BARIN
2022-01-16 19:47:16 +01:00
parent f6d7971b4f
commit c09a535653
73 changed files with 1197 additions and 2549 deletions

View File

@@ -1,5 +1,5 @@
import { Model, snakeCaseMappers } from 'objection';
import type { Constructor, TransactionOrKnex, QueryBuilderType, QueryContext, ModelOptions, ColumnNameMappers } from 'objection';
import type { QueryContext, ModelOptions, ColumnNameMappers } from 'objection';
class Base extends Model {
createdAt!: string;
@@ -9,14 +9,14 @@ class Base extends Model {
return snakeCaseMappers();
}
async $beforeInsert(queryContext: QueryContext) {
async $beforeInsert(queryContext: QueryContext): Promise<void> {
await super.$beforeInsert(queryContext);
this.createdAt = new Date().toISOString();
this.updatedAt = new Date().toISOString();
}
async $beforeUpdate(opt: ModelOptions, queryContext: QueryContext) {
async $beforeUpdate(opt: ModelOptions, queryContext: QueryContext): Promise<void> {
await super.$beforeUpdate(opt, queryContext);
this.updatedAt = new Date().toISOString();