mmkal / expect-type

Compile-time tests for types. Useful to make sure types don't regress into being overly-permissive as changes go in over time.
Other
413 stars 8 forks source link

Rename the `_ExpectTypeOf` type #106

Open aryaemami59 opened 2 months ago

aryaemami59 commented 2 months ago

If _ExpectTypeOf is going to be exported, we should probably rename it to something else to avoid confusion between _ExpectTypeOf and ExpectTypeOf.

mmkal commented 2 months ago

Yeah, I don't remember the thinking behind PositiveExpectTypeOf and NegativeExpectTypeOf and ExpectTypeOf being named that way - they're not types for the expectTypeOf function, they're asserter-things. Maybe renaming them is a better option. We should check if vitest/anything else publicly on GitHub is using the current names though.

aryaemami59 commented 2 months ago

Sounds good, I can look into it.

aryaemami59 commented 2 months ago

@mmkal Vitest is using ExpectTypeOf here, I still think we should rename that one too, what do you think?

mmkal commented 2 months ago

Hmm vitest is exporting it which means god knows how many people are using it!

aryaemami59 commented 2 months ago

Yeah that's unfortunate.

aryaemami59 commented 2 months ago

I guess we can hold off on renaming ExpectTypeOf but we can probably go ahead with renaming _ExpectTypeOf, NegativeExpectTypeOf and PositiveExpectTypeOf. What do you think?

mmkal commented 2 months ago

I'm getting the heebie-jeebies. While the naming is not totally appropriate, it's basically consistent right now. I don't want to make it inconsistent.

I think the most I'd be comfortable with pre-v1 would be _ExpectTypeOf -> CreateExpectTypeOf or something. Not sure it's even worth it though to be honest. Maybe this should just be a v2 thing.