Closed chrisui closed 2 years ago
This is not about plugin
@hosseinmd Can we please re-open this? I've shown in the linked repro and issue that the issue only occurs when this plugin is used.
What is the issue if it is not this plugin?
You have syntax error. "ok" and "error" are function, they aren't type, we could add generic to function just when calling them, but for your use case change your code to this
type OkType = typeof ok;
type ErrorType = typeof error
const okStr: OkType<string> = ok
const errnum: ErrorType<number> = error
Repro
https://github.com/chrisui/prettier-repros
See original bug report in prettier/prettier https://github.com/prettier/prettier/issues/13225