Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid index.d.ts files when look up for definition?

I enabled a webpack alias in my jsconfig.json file for VSCode.

But when I go to definition of a React component, I get 2 definitions:

  1. my react component
  2. an index.d.ts file of node_modules/@types/react

How do I get rid of the index.d.ts file ? Knowing that I use only jsx.

like image 876
popo63301 Avatar asked Sep 06 '25 00:09

popo63301


1 Answers

All of the components in the project are written using the React.FC type and are automatically exported.

One way to fix an issue with the "Goto Location: Multiple Definitions" feature in the Editor is to change the configuration from peek to goto.

enter image description here

This may hide some additional definitions that may be useful, but it will make the feature work as intended when clicking on components.

like image 82
jurcola Avatar answered Sep 09 '25 00:09

jurcola