Likely to cause new Flow errors:
- Enforce that interfaces are supertypes of objects and classes. Also prevent objects from being a supertype of a class.
- Improve soundness of
thistyping by banning the unbinding of class methods (see https://medium.com/flow-type/sound-typing-for-this-in-flow-d62db2af969e).
New Features:
- You can require an exhaustive check of an enum in a switch statement that includes a default branch. This is enabled with the comment
// flowlint-next-line require-explicit-enum-switch-cases:error. - Autocomplete for object keys.
- Introduce a
flow fixcommand to apply autofixes from the command line to a list of files. - Enable a new check mode that uses significantly less RAM for large projects.
Notable bug fixes:
- Fix a bug that allowed nested anonymous functions inside a default export.
- Using the
--ignore-versionflag also prevents Flow from crashing when an invalid option is in the.flowconfig.
Library Definitions:
- Support the
optionsparameter forrequire.resolve. (thanks @skeggse) - Return a TypedArray instead of
voidfrom TypedArraysortfunction. (thanks @goodmind) - Return a
DOMStringListinstead of a string array fromIDBDatabase.objectStoreNames. (thanks @bnelo12)
Misc:
- Add
--binaryto theflow versioncommand to see the path to the current binary. - Prevent the LSP from exiting when an invalid option is in the
.flowconfig. - Autofix for a
method-unbindingerror to replace the method with an arrow function. - Autofix for a
class-object-subtypingerror to replace the object type with an interface.