3π
β
In TypeScript, the type []
explicitly mean empty array/tuple.
type A = [];
const a: A = ['a'];
// Error -> Type '[string]' is not assignable to type '[]'
const a: A = [];
// No error
export default a;
Therefore, what you need to do is just explicitly set the return type with IssueType[]
instead of []
.
π€yqlim
Source:stackexchange.com