When building Vue components with TypeScript (using the lang="ts"
attribute in the script tag), there is a warning in PhpStorm (version 2021.2.2) that flags any methods from the native JavaScript Object
as "Unresolved function or method". For example:
<template>
...
</template>
<script lang="ts">
const values = Object.values({ a: 'a', b: 'b' });
</script>
This issue results in:
https://i.sstatic.net/BeIiP.png
How can PhpStorm (or WebStorm) be configured to recognize Object
as the native ES6+ JavaScript object?
(For your information, when Cmd + clicking on Object
, it takes you to lib.es5.d.ts
, indicating an incorrect assumption about the JavaScript version. However, in Languages & Frameworks > JavaScript settings, the version is already set to ECMAScript 6+)