eps1lon/types-react-codemod

Codemod for implict return in `ref`

Closed this issue · 0 comments

We let a lot of implicit returns in ref slide through since you can return anything from functions that are asssignable to () => void in TypeScript. It should've always used the VOID_OR_UNDEFINED_ONLY type hack but it didn't. Now that refs are typed as () => void | (() => void), we start flagging the implicit returns.

It's probably safe to codemod all these implicit returns away. But just in case people already use the Canary feature, we make it opt-in in preset-19.