expect-type icon indicating copy to clipboard operation
expect-type copied to clipboard

Rename the `_ExpectTypeOf` type

Open aryaemami59 opened this issue 1 year ago • 7 comments

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

aryaemami59 avatar Aug 15 '24 20:08 aryaemami59

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.

mmkal avatar Aug 20 '24 16:08 mmkal

Sounds good, I can look into it.

aryaemami59 avatar Aug 20 '24 16:08 aryaemami59

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

aryaemami59 avatar Aug 20 '24 23:08 aryaemami59

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

mmkal avatar Aug 21 '24 00:08 mmkal

Yeah that's unfortunate.

aryaemami59 avatar Aug 21 '24 00:08 aryaemami59

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?

aryaemami59 avatar Aug 21 '24 17:08 aryaemami59

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.

mmkal avatar Aug 23 '24 03:08 mmkal