Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated ES5 type definition (Parameters<T>) #1140

Closed
3 tasks done
pumpkinlink opened this issue Mar 7, 2019 · 1 comment
Closed
3 tasks done

Outdated ES5 type definition (Parameters<T>) #1140

pumpkinlink opened this issue Mar 7, 2019 · 1 comment
Milestone

Comments

@pumpkinlink
Copy link

pumpkinlink commented Mar 7, 2019

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: Linux
  • Vetur version: 0.16.2
  • VS Code version: 1.31.1

Problem

Vetur is apparently using an outdated version of es5 type definition, instead of the definitions from devDependencies/typescript. So if I try to use a more recent feature like Parameters or ConstructorParameters, it gives me an error, but NonNullable works fine.

screenshot from 2019-03-07 18-47-15
If I ctrl-click (Goto definition) on NonNullable, I'm taken to ~/.vscode/extensions/octref.vetur-0.16.2/server/node_modules/typescript/lib/lib.es5.d.ts:
screenshot from 2019-03-07 19-07-05

which is apparently outdated in comparison to my projects node_modules/typescript/lib/lib.es5.d.ts:
screenshot from 2019-03-07 19-07-33

The Parameters type was added on Typescript 3.1, my project is using TS 3.2.4

Reproducible Case

<template>
</template>

<script lang="ts">
import Vue from 'vue'

type nString = NonNullable<string> // works

const f = (a: string, b: number) => {}
type setupFilterParameters = Parameters<typeof f> // doesn't work, should return a type of [string, number]

export default Vue.extend({
  name: 'SetupFilterDialog',
  data: () => ({
  })
})
</script>
@octref
Copy link
Member

octref commented Mar 21, 2019

image

This seems to be solved in TS 3.3, which you can get by:

See #682 for details.

This issue will be completely gone after #1163.

@octref octref closed this as completed Mar 21, 2019
@octref octref added this to the March 2019 milestone Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants