Ask questionsSuggestion: Add $FlowIgnore to the standardized suppression comments
<!-- Please fill out this entire template so that we can evaluate your proposal as quickly as possible. -->
I'm writing this as a sort of preliminary issue, as the feature that this suggestion is about hasn't been released yet, but I happened to notice commit 99fa5bf37c5630b44d134df0f1e5e0b6cb0ffe16 that will apparently remove the custom suppress comments–feature.
I suggest that
$FlowIgnore is added to the list of possible suppressors.
<!-- Explain why you need this change and why this cannot be addressed with Flow's current set of features. -->
$FlowIgnore is already used a lot in the wild. While refactoring a codebase away from it would probably be easy regex replace job, it's still a lot of changed lines in a large number of repositories.
Also, in my opinion,
$FlowIgnore carries a semantic meaning that is different from the other mentioned suppressors (
$FlowExpectedError). To me,
$FlowIgnore implies that the next line does something that Flow can't know to be correct, nor is it supposed to know (so it's not a "FlowIssue"), but the next line is clear enough for the programmer to reason about and verify for correctness, so it's not necessarily something to be fixed either. The most common example of these for me have been down-casts and casts from exact type to another exact type that is a subset of the first, where I would very explicitly write something like
const _dog: Animal = animal // $FlowIgnore We know this is a Dog because its type was checked earlier. const dog: Dog = _dog
Edit: A lot of the code shearch hits for FlowIgnore seem to come from the same dependency, maybe this search result is better: grep.app.
Answer questions dsainati1