JoshuaKGoldberg / ts-api-utils

Utility functions for working with TypeScript's API. Successor to the wonderful tsutils. 🛠️️
https://joshuakgoldberg.github.io/ts-api-utils/
MIT License
55 stars 6 forks source link

🚀 Feature: be able to determine where a type is defined #501

Open RebeccaStevens opened 4 months ago

RebeccaStevens commented 4 months ago

Bug Report Checklist

Overview

Essentially adds the typeMatchesSpecifier function from ts-declaration-location.

This function is only for testing where a type is defined, not filtering the type based on its name or anything else. That could be new functionality in the future.

Additional Info

No response

JoshuaKGoldberg commented 4 months ago

It's an interesting idea! My personal inclination is that this should be a separate package. ts-api-utils is a lot of very generalized utilities. typesMatchesSpecifier is a pretty specific format that's also still relatively new in usage. Having the separate ts-declaration-location be able to iterate on its own feels right to me. Just my two cents 😄 putting into discussion.

RebeccaStevens commented 4 months ago

Yeah that makes sense. I'm perfectly happy to continue with it in its own repo.