Likely to cause new Flow errors:
- Flow has changed its casting syntax from
(x: T)tox as T. The default value of the optioncasting_syntaxis nowas, and Flow will error on the old syntax. If you want to preserve the old defualt value, addcasting_syntax=bothto your.flowconfig. You can use the npm packageflow-upgradeto upgade:yarn run flow-codemod typeCastToAsExpression. Read the docs for more.
New Features:
- Exported class setters no longer require an explicit type annotation:
voidis used if omitted
Parser:
- The flow-parser estree output now aligns more with hermes-parser:
ArrayExpressiongains atrailingCommafield, optional chaining is wrapped in aChainExpression,AssertNonnull(expr!) emits aNonNullExpressioninstead of an optional node, type-positionthisemitsThisTypeAnnotation, andTypeParameter.boundis now a bare type node without theTypeAnnotationwrapper.