Twoslash and $ExpectType
have different behavior
#74
Labels
status: needs investigation
Further research required...?
$ExpectType
have different behavior
#74
🐛 Bug Report
eslint-plugin-expect-type
version: 0.2.2Actual Behavior
Full reduced test case here: https://github.com/OliverJAsh/eslint-plugin-expect-type-issue
Contents inlined below.
package.json
:tsconfig.json
:.eslintrc.js
:source.ts
:test.ts
:$ExpectType
expects:Compact<Record<"a" | "b", number> | Record<"a" | "c", number>>
I believe the reason for this difference is because Twoslash and
$ExpectType
use different mechanisms to generate the "actual" value:languageService.getQuickInfoAtPosition
$ExpectType
:checker.typeToString
This particular issue started after we upgraded to TypeScript 5. Prior to this,
$ExpectType
had the same behavior as Twoslash in this particular example. I'm not sure why this has changed.Expected Behavior
Twoslash queries and
$ExpectType
should behave the same.Reproduction
https://github.com/OliverJAsh/eslint-plugin-expect-type-issue
The text was updated successfully, but these errors were encountered: