This repo tries to give examples and is an monorepo (PNPM) utilzing tsdown.
Location: Go To File
Package: Go To Package
Normal modern ESM modules work quite well. Clicking on the interface or type goes to the correct line and file.
Not much to replicate here, as it works quite well.
Issues
- However, clicking on the property of a type (e.g., the
idproperty on theaccountobject or any of its inner objects) will take you to the interface where it is declared, rather than the specific line where the property itself is defined. Most likely, what is desired is the actual line where the property is declared, not the line for the declared interface.
Location: Go To File
Package: Go To Package
Namespaces sometimes struggle with declaration maps. For example:
Steps
- Clicking on
Types.Utils.OrdersListinbackend/src/scenarios/namespaced.tswill take you to the line forProductsListinstead. - Clicking on
Types.Utils.ProductsListwill take you to theUtilsnamespace instead of the actual interface or type for that object. - Clicking on properties within namespaces will take you to the namespace rather than the actual interface or type for that object.
Issues
- Some navigations will take you to wrong interface or type
- Some navigations go to the namespace line, instead of the actual implementation of property, type or interface.
Location: Go To File
Package: Go To Package
This is referred to as "export-as" in the project. These exports don't always work well but sometimes perform correctly.
Steps
- Clicking on properties goes to the correct interface but not the specific line.
- Clicking on the outermost accessed type (e.g.,
Types.Account.Default) will take you to the correct type when clicking on "Default." - However, clicking on "Account" on the same line will take you to another separate file in the same package/library (e.g.,
src/utils/utils.tsinstead ofsrc/utils/account-types/account.ts).
This indicates some inconsistencies in how the declaration map handles these cases.
Issues
- Some navigations points to a whole other file (step 3).