-1

I keep getting this error and I'm not sure what to do?[1] [1]: https://i.stack.imgur.com/mQ3Xo.png

1 Answers1

0

you should type the array

private cartItems = [] as Product[];

per typescript eslint default rules https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-as-const.md

Shay
  • 1,245
  • 7
  • 14