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
parent
commit
0ad326b7c8
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 14
      apps/api/src/services/queues/portfolio-snapshot/portfolio-snapshot.service.mock.ts
  2. 4
      tsconfig.base.json

14
apps/api/src/services/queues/portfolio-snapshot/portfolio-snapshot.service.mock.ts

@ -1,4 +1,4 @@
import { Job, JobOptions } from 'bull'; import type { Job, JobId, JobOptions } from 'bull';
import { setTimeout } from 'timers/promises'; import { setTimeout } from 'timers/promises';
import { PortfolioSnapshotQueueJob } from './interfaces/portfolio-snapshot-queue-job.interface'; import { PortfolioSnapshotQueueJob } from './interfaces/portfolio-snapshot-queue-job.interface';
@ -10,8 +10,8 @@ export const PortfolioSnapshotServiceMock = {
data: PortfolioSnapshotQueueJob; data: PortfolioSnapshotQueueJob;
name: string; name: string;
opts?: JobOptions; opts?: JobOptions;
}): Promise<Job<any>> { }): Promise<Job> {
const mockJob: Partial<Job<any>> = { const mockJob: Partial<Job> = {
finished: async () => { finished: async () => {
await setTimeout(100); await setTimeout(100);
@ -21,12 +21,12 @@ export const PortfolioSnapshotServiceMock = {
this.jobsStore.set(opts?.jobId, mockJob); 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); 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>>()
}; };

4
tsconfig.base.json

@ -29,12 +29,12 @@
"strictPropertyInitialization": false, "strictPropertyInitialization": false,
"noImplicitReturns": false, "noImplicitReturns": false,
"noImplicitAny": false, "noImplicitAny": false,
"noImplicitThis": false, "noImplicitThis": true,
"noImplicitOverride": false, "noImplicitOverride": false,
"noPropertyAccessFromIndexSignature": false, "noPropertyAccessFromIndexSignature": false,
"noUnusedLocals": true, "noUnusedLocals": true,
"noUnusedParameters": true, "noUnusedParameters": true,
"allowUnreachableCode": true "allowUnreachableCode": false
}, },
"exclude": ["node_modules", "tmp"] "exclude": ["node_modules", "tmp"]
} }

Loading…
Cancel
Save