Browse Source
Task/enforce noImplicitThis and allowUnreachableCode TypeScript rules (#7354)
* feat(ts): disable allowing unreachable code
* feat(ts): enable no implicit this
pull/7361/head
Kenrick Tandrian
2 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
9 additions and
9 deletions
-
apps/api/src/services/queues/portfolio-snapshot/portfolio-snapshot.service.mock.ts
-
tsconfig.base.json
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
import { Job, JobOptions } from 'bull'; |
|
|
|
import type { Job, JobId, JobOptions } from 'bull'; |
|
|
|
import { setTimeout } from 'timers/promises'; |
|
|
|
|
|
|
|
import { PortfolioSnapshotQueueJob } from './interfaces/portfolio-snapshot-queue-job.interface'; |
|
|
|
@ -10,8 +10,8 @@ export const PortfolioSnapshotServiceMock = { |
|
|
|
data: PortfolioSnapshotQueueJob; |
|
|
|
name: string; |
|
|
|
opts?: JobOptions; |
|
|
|
}): Promise<Job<any>> { |
|
|
|
const mockJob: Partial<Job<any>> = { |
|
|
|
}): Promise<Job> { |
|
|
|
const mockJob: Partial<Job> = { |
|
|
|
finished: async () => { |
|
|
|
await setTimeout(100); |
|
|
|
|
|
|
|
@ -21,12 +21,12 @@ export const PortfolioSnapshotServiceMock = { |
|
|
|
|
|
|
|
this.jobsStore.set(opts?.jobId, mockJob); |
|
|
|
|
|
|
|
return Promise.resolve(mockJob as Job<any>); |
|
|
|
return Promise.resolve(mockJob as Job); |
|
|
|
}, |
|
|
|
getJob(jobId: string): Promise<Job<any>> { |
|
|
|
getJob(jobId: JobId): Promise<Job> { |
|
|
|
const job = this.jobsStore.get(jobId); |
|
|
|
|
|
|
|
return Promise.resolve(job as Job<any>); |
|
|
|
return Promise.resolve(job as Job); |
|
|
|
}, |
|
|
|
jobsStore: new Map<string, Partial<Job<any>>>() |
|
|
|
jobsStore: new Map<JobId, Partial<Job>>() |
|
|
|
}; |
|
|
|
|
|
|
|
@ -29,12 +29,12 @@ |
|
|
|
"strictPropertyInitialization": false, |
|
|
|
"noImplicitReturns": false, |
|
|
|
"noImplicitAny": false, |
|
|
|
"noImplicitThis": false, |
|
|
|
"noImplicitThis": true, |
|
|
|
"noImplicitOverride": false, |
|
|
|
"noPropertyAccessFromIndexSignature": false, |
|
|
|
"noUnusedLocals": true, |
|
|
|
"noUnusedParameters": true, |
|
|
|
"allowUnreachableCode": true |
|
|
|
"allowUnreachableCode": false |
|
|
|
}, |
|
|
|
"exclude": ["node_modules", "tmp"] |
|
|
|
} |
|
|
|
|