7

My objective is a working Angular v10 project, using .flat() on arrays. Our team recently upgraded our Angular project to version 10. The project now, based on the Angular CLI, has the following files in the root:

  1. tsconfig.base.json
  2. tsconfig.json

Everything works, but our IDE (vs code), gives us the warning:

Property 'flat' does not exist on type 'string[][]'.ts(2339)

According to this answer on SO, adding es2019 to the lib property should fix the issue. But I have added "es2019" to both tsconfig.base.json and tsconfig.json to no help.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
DauleDK
  • 3,313
  • 11
  • 55
  • 98

1 Answers1

5

In my case, I already had something in "lib" so I just changed the es from 2018 to 2019:

From:

"lib": ["es2018", "dom"]

To:

"lib": ["es2019", "dom"]

(And it took about 30-60 seconds before Code recognized the changes in my ts files)

Brian Davis
  • 745
  • 1
  • 11
  • 14