Reputation: 11127
When creating Vue components using TypeScript (via the lang="ts"
attribute of the script tag), PhpStorm (version 2021.2.2) shows a warning about any methods of the native JavaScript Object
as "Unresolved function or method", e.g.:
<template>
...
</template>
<script lang="ts">
const v = Object.values({ a: 'a', b: 'b' });
</script>
Results in:
How can PhpStorm (or WebStorm) be configured to recognise Object
as the native JS ES6+ Object
?
(For reference, Cmd + clicking on Object
jumps to lib.es5.d.ts
so it's assuming the wrong version of JavaScript. However, under Languages & Frameworks > JavasScript, the version is already set to ECMAScript 6+)
Upvotes: 1
Views: 547
Reputation: 93728
Object.values()
is part of ES2017.
Make sure to either set "target"
to "esnext"
or add "esnext"
to "lib": []
in tsconfig.json
Upvotes: 1