Closed STRML closed 8 years ago
@STRML typecheck should never throw on syntax that it doesn't understand for exactly this reason, so the behaviour you're seeing is definitely a bug and maybe it's worth updating the 2.x branch. In 3.x it will simply ignore the annotation. Arguably we should add a mode which warns when we see this stuff, but we should never prevent the programmer from using it.
To add, we could definitely consider adding pragmas in comments in a similar fashion to jshint ignore: line
etc.
Both sound good to me. There's always the risk that new Flow syntax will expand old, leading typecheck to misunderstand existing syntax. So the comments would be a big help.
Thanks! This is a big help.
Thanks for the great work on this plugin.
As I convert my project to Flow, I've been noticing some incompatibilities between the two libraries.
Some of this is because I am still stuck on Babel 5 / Typecheck 2.0.0 due to react-transform not yet releasing a Babel 6 plugin.
For example, the following definition is valid Flow but throws in plugin-typecheck:
The error is:
For now I have commented the line, set the type to
any
and put a big FIXME on it until I am able to update to the newest typecheck lib. But in case this happens again in the future (and I assume it will, as Flow receives new features), is there a way for us to get typecheck to simply ignore a line?