It would be more clear if you share the linter error you get.
forEach will iterate over the elements (without visiting new elements added at runtime) of an array and returns undefined.
If you need to return a value AND a new array, you use map. Since it returns another array, chaining map will be easier.