When I want to reference a definition I press ctrl and left click on the variable, VSCode brings me to the definition. The problem is if a module has both index.js
and index.d.ts
, VS Code will bring me to the index.d.ts
file which has no meaningful logic code. It's totally unusable to debug or to understand the implementation.
var cookieSession = require('cookie-session')
var express = require('express')
For example, ctrl + left click on the cookie-session
VSCode brings me to ./node_modules/@types/cookie-session/index.d.ts:115
instead of ./node_modules/cookie-session/index.js
where it shows:
declare module "cookie-session" {
import express = require('express');
function cookieSession(options?: CookieSessionInterfaces.CookieSessionOptions): express.RequestHandler;
export = cookieSession;
}