microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 235 forks source link

Incorrect type check in sublime #675

Closed hronro closed 4 years ago

hronro commented 6 years ago

I have write my own d.ts file to extend the request object with property cookies:

import * as fastify from 'fastify';

declare module 'fastify' {
  interface FastifyRequest<HttpRequest> {
    cookies: {
      [cookieName: string]: string | undefined;
    };
  }
}

And I can also build successful using command tsc, but in the sublime editor, I got this error:

image

And VS Code can handle this correctly:

image

DanielRosenwasser commented 5 years ago

I'm not able to see this behavior. Try out with the latest version and provide a self-contained repro of the issue

hronro commented 5 years ago

@DanielRosenwasser

I fixed this problem by npm install TypeScript globally.

Actually I would like to know which TypeScript instance is used by sublime typescript plugin? The one installed in current project? The one bundled with Sublime plugin? Or the one installed globally?