Skip to content

Commit 5392b96

Browse files
committed
fix: Specify Record for returned type on loadJSON rejects
1 parent 30544f1 commit 5392b96

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/schema/context.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export class BIDSContext implements Context {
208208
}
209209
}
210210
for (const file of sidecars) {
211-
const json = await loadJSON(file).catch((error) => {
211+
const json = await loadJSON(file).catch((error): Record<string, unknown> => {
212212
if (error.key) {
213213
this.dataset.issues.add({ code: error.key, location: file.path })
214214
return {}
@@ -218,14 +218,12 @@ export class BIDSContext implements Context {
218218
})
219219
const overrides = Object.keys(this.sidecar).filter((x) => Object.hasOwn(json, x))
220220
for (const key of overrides) {
221-
// @ts-ignore
222221
if (json[key] !== this.sidecar[key]) {
223222
const overrideLocation = this.sidecarKeyOrigin[key]
224223
this.dataset.issues.add({
225224
code: 'SIDECAR_FIELD_OVERRIDE',
226225
subCode: key,
227226
location: overrideLocation,
228-
// @ts-ignore
229227
issueMessage: `Sidecar key defined in ${file.path} overrides previous value (${json[key]}) from ${overrideLocation}`,
230228
})
231229
}

0 commit comments

Comments
 (0)