Skip to content

Commit

Permalink
chore: fix eslint problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Kampfmoehre committed Jul 31, 2023
1 parent 0f1d0f1 commit f858095
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/JobRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export class JobRepository<TParams, TResult>

/**
* Initializes a new instance of the @see JobRepository class.
*
* @param {EntityManager} manager The entity manager to use for the underlying repository.
* @param {QueryRunner} queryRunner The query runner for the underlying repository.
* @param {LoggerFactory} loggerFactory The logger factory to create a logger for the repo.
Expand All @@ -64,7 +63,6 @@ export class JobRepository<TParams, TResult>

/**
* Initializes the logger for this repository instance.
*
* @param {Record<string, unknown>} meta Additional data to attach to the logger instance.
*/
public initLogger(meta?: Record<string, unknown>): void {
Expand Down Expand Up @@ -97,8 +95,7 @@ export class JobRepository<TParams, TResult>
}

cancellationToken?.throwIfCancelled();
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const info = await this.insert(job as any);
const info = await this.insert(job as never);
job.id = (info.identifiers[0] as { id: number }).id;

this.logger?.info(`Added job ${job.id} with type ${job.type} due ${job.dueDate.toISOString()}.`);
Expand Down Expand Up @@ -285,8 +282,7 @@ export class JobRepository<TParams, TResult>

cancellationToken?.throwIfCancelled();

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
job = await this.manager.save(Job, job as any);
job = await this.manager.save(Job, job as Job<TParams, TResult>);

this.logger?.info(
{ jobId: job.id, runner: job.runner },
Expand Down Expand Up @@ -314,8 +310,7 @@ export class JobRepository<TParams, TResult>
job.successfulItems = null as unknown as undefined;
job.failedItems = null as unknown as undefined;

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
job = await this.manager.save(Job, job as any);
job = await this.manager.save(Job, job);

this.logger?.info("Resetted job %d on runner %s", job.id, runnerName);

Expand Down
2 changes: 2 additions & 0 deletions test/JobRepository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,13 @@ describe("JobRepository", () => {
let transaction: <T>(runInTransaction: (entityManager: EntityManager) => Promise<T>) => Promise<T>;
beforeAll(() => {
repo = getJobRepo<never, never>(dataSource);
// eslint-disable-next-line @typescript-eslint/unbound-method
transaction = repo.manager.transaction;
});

afterAll(() => {
if (repo) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
repo.manager.transaction = transaction;
}
Expand Down

0 comments on commit f858095

Please sign in to comment.