Skip to content

Commit 6d0ff43

Browse files
committed
chore: fix job-worker linter/type errors
1 parent acf2c07 commit 6d0ff43

27 files changed

+35
-59
lines changed

packages/job-worker/src/__mocks__/_setupMocks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-var-requires */
1+
/* eslint-disable @typescript-eslint/no-require-imports */
22

33
import './_extendJest.js'
44

packages/job-worker/src/blueprints/__tests__/context-OnSetAsNextContext.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-non-null-assertion, @typescript-eslint/unbound-method */
1+
/* eslint-disable @typescript-eslint/unbound-method */
22
import { IBlueprintMutatablePart, IBlueprintPiece } from '@sofie-automation/blueprints-integration'
33
import { PlayoutModel } from '../../playout/model/PlayoutModel.js'
44
import { WatchedPackagesHelper } from '../context/watchedPackages.js'

packages/job-worker/src/blueprints/__tests__/context-OnTakeContext.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-non-null-assertion, @typescript-eslint/unbound-method */
1+
/* eslint-disable @typescript-eslint/unbound-method */
22
import { IBlueprintMutatablePart, IBlueprintPiece } from '@sofie-automation/blueprints-integration'
33
import { PlayoutModel } from '../../playout/model/PlayoutModel.js'
44
import { WatchedPackagesHelper } from '../context/watchedPackages.js'

packages/job-worker/src/blueprints/__tests__/context-adlibActions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-non-null-assertion, @typescript-eslint/unbound-method */
1+
/* eslint-disable @typescript-eslint/unbound-method */
22
import { IBlueprintMutatablePart, IBlueprintPart, IBlueprintPiece } from '@sofie-automation/blueprints-integration'
33
import { ActionExecutionContext } from '../context/adlibActions.js'
44
import { PlayoutModel } from '../../playout/model/PlayoutModel.js'

packages/job-worker/src/blueprints/__tests__/postProcess.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ describe('Test blueprint post-process', () => {
111111

112112
// Certain fields should be defined by simple rules
113113
expect(res.filter((r) => r.id === '')).toHaveLength(0)
114-
expect(res.filter((r) => r.objectType !== 'rundown')).toHaveLength(0)
114+
expect(res.filter((r) => r.objectType !== TimelineObjType.RUNDOWN)).toHaveLength(0)
115115

116116
// Ensure no ids were duplicates
117117
const ids = res.map((obj) => obj.id)
@@ -229,7 +229,7 @@ describe('Test blueprint post-process', () => {
229229

230230
// Certain fields should be defined by simple rules
231231
expect(res.filter((r) => r.id === '')).toHaveLength(0)
232-
expect(res.filter((r) => r.objectType !== 'rundown')).toHaveLength(0)
232+
expect(res.filter((r) => r.objectType !== TimelineObjType.RUNDOWN)).toHaveLength(0)
233233

234234
// Ensure getHash was called as expected
235235
expect(getHashMock).toHaveBeenCalledTimes(2)

packages/job-worker/src/blueprints/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export async function retrieveBlueprintConfigRefs(
3434
const refs = stringWithReferences.match(/\$\{[^}]+\}/g) || []
3535
for (const ref of refs) {
3636
if (ref) {
37+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
3738
let value = (await retrieveBlueprintConfigRef(context, ref, bailOnError)) + ''
3839
if (value) {
3940
if (modifier) value = modifier(value)

packages/job-worker/src/blueprints/context/OnTakeContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ export class OnTakeContext extends ShowStyleUserContext implements IOnTakeContex
111111
return this.partAndPieceInstanceService.updatePartInstance(part, props)
112112
}
113113

114-
async stopPiecesOnLayers(sourceLayerIds: string[], timeOffset?: number | undefined): Promise<string[]> {
114+
async stopPiecesOnLayers(sourceLayerIds: string[], timeOffset?: number): Promise<string[]> {
115115
return this.partAndPieceInstanceService.stopPiecesOnLayers(sourceLayerIds, timeOffset)
116116
}
117-
async stopPieceInstances(pieceInstanceIds: string[], timeOffset?: number | undefined): Promise<string[]> {
117+
async stopPieceInstances(pieceInstanceIds: string[], timeOffset?: number): Promise<string[]> {
118118
return this.partAndPieceInstanceService.stopPieceInstances(pieceInstanceIds, timeOffset)
119119
}
120120
async removePieceInstances(part: 'next', pieceInstanceIds: string[]): Promise<string[]> {

packages/job-worker/src/blueprints/context/adlibActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ export class ActionExecutionContext extends ShowStyleUserContext implements IAct
175175
return this.partAndPieceInstanceService.updatePartInstance(part, props)
176176
}
177177

178-
async stopPiecesOnLayers(sourceLayerIds: string[], timeOffset?: number | undefined): Promise<string[]> {
178+
async stopPiecesOnLayers(sourceLayerIds: string[], timeOffset?: number): Promise<string[]> {
179179
return this.partAndPieceInstanceService.stopPiecesOnLayers(sourceLayerIds, timeOffset)
180180
}
181181

182-
async stopPieceInstances(pieceInstanceIds: string[], timeOffset?: number | undefined): Promise<string[]> {
182+
async stopPieceInstances(pieceInstanceIds: string[], timeOffset?: number): Promise<string[]> {
183183
return this.partAndPieceInstanceService.stopPieceInstances(pieceInstanceIds, timeOffset)
184184
}
185185

packages/job-worker/src/blueprints/context/services/__tests__/PartAndPieceInstanceActionService.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,6 @@ describe('Test blueprint api context', () => {
16031603

16041604
await expect(service.removePieceInstances('next', [])).resolves.toEqual([])
16051605
await expect(
1606-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
16071606
service.removePieceInstances('next', [unprotectString(pieceInstanceFromOther._id)])
16081607
).resolves.toEqual([]) // Try and remove something belonging to a different part
16091608
expectCountsToEqual(getPieceInstanceCounts(playoutModel), beforePieceInstancesCounts)

packages/job-worker/src/blueprints/ingest/MutableIngestPartImpl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export class MutableIngestPartImpl<TPartPayload = unknown> implements MutableIng
5151
}
5252

5353
if (this.#hasChanges || !_.isEqual(this.#ingestPart.payload[key], value)) {
54-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
5554
;(this.#ingestPart.payload as any)[key] = clone(value)
5655
this.#hasChanges = true
5756
}

0 commit comments

Comments
 (0)