Type annotations can only be used in TypeScript files.ts
- install the extension Flow Language Support
- disable the built-in TypeScript extension:
How to disable built-in TypeScript:
- go to extensions tab
- search for @builtin TypeScript and JavaScript Language Features
- click on Disable