I had this issue on a TypeScript project:

error TS7005: Variable 'tagArray' implicitly has an 'any[]' type.

Solution

The solution was to cast the array better. Typescript needs to know what is going in the array:

Before

const tagArray = [];

After

const tagArray: number[] = [];