"Types are not supported by current JavaScript version" in PhpStorm

Viewed 2897

I'm working in PhpStorm on a Vue 2 / TypeScript project where whenever I want to include return types on functions I get "Types are not supported by current JavaScript version":

Types are not supported by current JavaScript version

On "Preferences > Languages and Frameworks > JavaScript", I have ECMAScript 6+ selected:

selected

I've tried restarting the IDE to no avail.

Any ideas?

1 Answers

Ah, apparently I was misled by the wording of the error message. Simply adding <script lang="ts"> inside my vue files has fixed it.

Related