Adds static typing to JavaScript to improve developer productivity and code quality.
MIT License
Bot releases are visible (Hide)
Published by facebook-github-bot almost 3 years ago
Notable bug fixes:
Published by facebook-github-bot almost 3 years ago
Notable bug fixes:
@flow
modesMisc:
--profile
, --json
and --pretty
flags from flow force-recheck
Library Definitions:
Published by facebook-github-bot almost 3 years ago
Published by facebook-github-bot almost 3 years ago
flow check-contents
on non-Flow files by default; pass --all
to force it.--weak
CLI flag and weak=true
flowconfig option have been removed.Published by facebook-github-bot almost 3 years ago
Notable bug fixes:
Likely to cause new Flow errors:
declare var
syntax be annotated with a type. declare var x;
is now illegal.Notable bug fixes:
flow autocomplete
on non-Flow files.export default class
definitionsPublished by facebook-github-bot almost 3 years ago
New Features:
exports
/module.exports
can no longer be read from in a module (e.g. exports.foo
) to eliminate this usage of unsealed objects - you can refactor your code to directly reference foo
instead, or just use ES modules (e.g. export const foo = ...
)typeof
type annotations.$ElementType
and $PropertyType
utilities.indexed_access
option, it's always enabled now (was on by default before if the option was omitted).Notable bug fixes:
refactor
code-action would hang on large inputs.import typeof Foo
rather than import type {Foo}
watchman
on Windows.$ExactT<...>
type annotations.this
in a JSX title member.flow coverage
now returns 0% for non-@flow files; pass --all
to also check non-@flow files.flow get-def
on non-Flow files.flow type-at-pos
on non-Flow filesCompletionItemLabelDetail
Library Definitions:
navigator.clipboard.write
type and add ClipboardItem
(thanks @Egrodo).fs.copyFile
overload to support the case where the mode
param is not specified (thanks @Brianzchen).Misc:
flow suggest
command.flow find-refs
command.--expand-type-aliases
flag from all Flow commands, it has caused several performance and non-termination issues without providing much value.Parser:
typeof
type annotations, where the argument to typeof
is a not a variable or member expression, are now parse errors rather than type errors.Published by facebook-github-bot almost 3 years ago
New Features:
*
type is now an alias to any
. You can use flow codemod replace-existentials
, which is available in previous versions of Flow, to upgrade your codebase to not use *
. This codemod command will not be available in the current or future versions of Flow.flow ast
command.Notable bug fixes:
$KeyMirror
so that it respects the optionality of its arguments.JSON
as object rather than a class. This prevents code such as new JSON()
which is a runtime error.Library Definitions:
InputEvent.dataTransfer
AggregateError
class - fixes #8764 (thanks @lachlanhunt).UIEvent
, InputEvent
and KeyboardEvent
types.Misc:
Parser:
#
in private identifiers.Published by facebook-github-bot about 3 years ago
node_modules
were shown in lazy mode. It is now consistent with non-lazy mode.Published by facebook-github-bot about 3 years ago
Likely to cause new Flow errors:
null
(let x: null = null
); if only undefined, then it can be annotated with void
(let x: void;
).New Features:
$Partial
utility type. This utility converts all of an object's or interface's named fields to be optional, while maintaining all the object's other properties (exactness, sealedness, etc).Notable bug fixes:
strict_es6_import_export
--autostop
Misc:
import.meta
as objectdeclare function
format.single_quotes
settingLikely to cause new Flow errors:
New Features:
string
and number
, as well as utility types like $Call
and $Keys
.Notable changes:
Notable bug fixes:
[lints]
section are now ignored when passing --ignore-version
.$ReadOnly
types.flow-remove-types
:
flow-remove-types/jest
Published by facebook-github-bot about 3 years ago
Published by facebook-github-bot about 3 years ago
New Features:
The ide
, fs
and watchman
lazy modes have been merged into a single mode. The new mode is now SCM-aware with or without Watchman; when the server starts, it queries Git or Mercurial and checks all existing local changes (changes since the mergebase).
The file_watcher.watchman.mergebase_with
config option has been renamed to file_watcher.mergebase_with
; set this to the name of your default remote branch (e.g. origin/main
).
Flowconfig setting migration:
lazy_mode=watchman
-> lazy_mode=true
, file_watcher=watchman
lazy_mode=fs
-> lazy_mode=true
lazy_mode=ide
-> lazy_mode=true
lazy_mode=none
-> lazy_mode=false
Added parser support for import.meta
Added type checking support for new.target
and import.meta
as mixed
Library Definitions:
queueMicrotask
Notable bug fixes:
Published by facebook-github-bot about 3 years ago
New Features:
file_watcher=watchman
and lazy_mode=fs
can now upgrade to lazy_mode=watchman
.$ObjMapi<T, <K>(K) => K>
to $KeyMirror<T>
. Run it via flow codemod key-mirror [OPTION]... [FILE]
.Library Definitions:
devicePixelRatio
global (thanks @Brianzchen)Published by facebook-github-bot about 3 years ago
New Features:
Notable changes:
#foo: () => 'foo'
could not be called, leading to workarounds like this.#foo.call(this)
$NonMaybeType<...>
module.system.haste.module_ref_prefix=m#
, "m#Foo"
will jump to the Foo
module)file_watcher.watchman.survive_restarts
setting is now true
by default. This setting is deprecated and will be removed in a future version.--retry-if-init
CLI flag has been removed. Setting it to false
previously caused the command to error if the server was already running but not yet ready. Instead, use --timeout
to avoid waiting too long.Parser:
flow-remove-types
:
Published by facebook-github-bot about 3 years ago
Likely to cause new Flow errors:
break
and continue
branches.New Features:
experimental.refactor=false
to the .flowconfig
.eslint-plugin-fb-flow
, for eslint rules from the Flow team. The first rule is use-indexed-access-type
to encourage the use of indexed access types (https://flow.org/en/docs/types/indexed-access/).update-suppressions
to the flow tool (fixes #8384).Library Definitions:
Misc:
Published by facebook-github-bot over 3 years ago
New Features:
0.143.0
. Can be disabled per project with the autoimports=false
flowconfig option, or per user with the flow.suggest.autoImports
LSP configuration.Library Definitions:
Published by facebook-github-bot over 3 years ago
Fix bug in shared memory garbage collection which caused Flow to crash.
Published by facebook-github-bot over 3 years ago
Likely to cause new Flow errors:
this
inside of object methods (see https://medium.com/flow-type/sound-typing-for-this-in-flow-d62db2af969e).Notable bug fixes:
$ReadOnly
utilityLibrary Definitions: