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
this
typing 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 fix
command 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-version
flag also prevents Flow from crashing when an invalid option is in the.flowconfig
.
Library Definitions:
- Support the
options
parameter forrequire.resolve
. (thanks @skeggse) - Return a TypedArray instead of
void
from TypedArraysort
function. (thanks @goodmind) - Return a
DOMStringList
instead of a string array fromIDBDatabase.objectStoreNames
. (thanks @bnelo12)
Misc:
- Add
--binary
to theflow version
command 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-unbinding
error to replace the method with an arrow function. - Autofix for a
class-object-subtyping
error to replace the object type with an interface.