thisflowtype

Possible to annotate inline "this" with comment types with Flow?


Getting this error:

Missing an annotation on implicit this parameter of function.

Would be nice to be able to annotate this with comment types. Possible?

https://flow.org/en/docs/types/comments/


Solution

  • You can put any Flow syntax that isn't supposed to be seen in the JS output inside /*:: (two times :) and */. Including the whole this annotation.

    
    function baz(/*:: this: Foo */){}
    
    

    Try Flow