How to declare an empty array type that is inside a JSON file?

Viewed 367

I have this line of code that makes Typescript fire off an error:

const owner:boolean = jsonFile.owners.includes("10");

jsonFile is what I did from

import * as jsonFile from './dir/to/json/file.json'

Owners is an empty string[].

This is the error:

Argument of type 'string' is not assignable to parameter of type 'never'.

I know that I need to assign the type to this array, e.g. make it never[] -> string[], how would I do that? Preferably without strictNullChecks under tsconfig (solves this problem)

0 Answers
Related