Fix a regression in 0.198.0 that can lead to a crash
v0.198.0
Likely to cause new Flow errors:
Implicit coercion of booleans to numbers is consistently disallowed. Previously, booleans could be implicitly coerced to numbers in addition expressions. Prefer explicitly converting booleans to numbers.
Binary arithmetic errors are now reported on the expression rather than the operands, and use error code unsafe-arithmetic.
keyof, undefined, never, unknown, and readonly are now reserved types. If you have a user-defined types of these names, rename them to something else.
New Features:
TypeScript syntax helpers. To help people familiar with TypeScript syntax ramp up on similar Flow syntax:
Parse and error on keyof type operator, recommending $Keys<...> instead.
Parse and error on undefined type, recommending void instead.
Parse and error on never type, recommending empty instead.
Parse and error on unknown type, recommending mixed instead.
Parse and error on readonly applied to tuple and array type syntax.
Parse and error on usage of in/out/in out variance annotations.
Parse and error on as, as const, and satisfies cast expressions.
Add a codemod to fix underconstrained-implicit-instantiation errors only detectable under LTI. You can run flow codemod annotate-implicit-instantiations --include-lti --ignore-suppressed --write .
Notable bug fixes:
Fix a bug in LTI mode where some errors were hidden in implicit instantiation calls (e.g. Try Flow)
Fix unsound behavior of sentinel refinement with unions of numeric types as tags (e.g. Try Flow)
No annotation is required in LTI for callback parameters when the callee is a refined object member (e.g. Try Flow)
IDE:
When typing in an object literal, entire method signatures from the object type will be suggested.
Method signature autocomplete items are now visually distinguished from other kinds of autocomplete items.
Fix manually triggering autocomplete on the last empty line of a file giving no results.
Members from Object.prototype are no longer included in autocomplete results.
Parser:
Fix parsing of for await (async of ...) (regressed in 0.197.0)
Fix parsing of for (let in x) in non-strict mode
Fix parsing of class fields named static
Fix missing parse errors on keywords containing escape sequences (regressed in 0.180.0)
Fix missing parse error when using await as a parameter in an async arrow function
Fix missing parse error for export { ReservedWord as ... }
Fix incorrect parse error on export * as ReservedWord from ..., which is now allowed
Treat && and || as tokens when parsing types to improve error messages
Parse the argument of the typeof type argument as a value, not a type, as it is a value
Library Definitions:
Add Element.getAttributeNames(): Array<string>
v0.197.0
Local Type Inference:
We are releasing a new inference mode called local type inference. You can enable this new mode in your codebase by adding inference_mode=lti to the [options] section in the flowconfig. We will describe more details on this inference mode in an upcoming blog post.
Fix a regression in 0.198.0 that can lead to a crash
0.198.0
Likely to cause new Flow errors:
Implicit coercion of booleans to numbers is consistently disallowed. Previously, booleans could be implicitly coerced to numbers in addition expressions. Prefer explicitly converting booleans to numbers.
Binary arithmetic errors are now reported on the expression rather than the operands, and use error code unsafe-arithmetic.
keyof, undefined, never, unknown, and readonly are now reserved types. If you have a user-defined types of these names, rename them to something else.
New Features:
TypeScript syntax helpers. To help people familiar with TypeScript syntax ramp up on similar Flow syntax:
Parse and error on keyof type operator, recommending $Keys<...> instead.
Parse and error on undefined type, recommending void instead.
Parse and error on never type, recommending empty instead.
Parse and error on unknown type, recommending mixed instead.
Parse and error on readonly applied to tuple and array type syntax.
Parse and error on usage of in/out/in out variance annotations.
Parse and error on as, as const, and satisfies cast expressions.
Add a codemod to fix underconstrained-implicit-instantiation errors only detectable under LTI. You can run flow codemod annotate-implicit-instantiations --include-lti --ignore-suppressed --write .
Notable bug fixes:
Fix a bug in LTI mode where some errors were hidden in implicit instantiation calls (e.g. Try Flow)
Fix unsound behavior of sentinel refinement with unions of numeric types as tags (e.g. Try Flow)
No annotation is required in LTI for callback parameters when the callee is a refined object member (e.g. Try Flow)
IDE:
When typing in an object literal, entire method signatures from the object type will be suggested.
Method signature autocomplete items are now visually distinguished from other kinds of autocomplete items.
Fix manually triggering autocomplete on the last empty line of a file giving no results.
Members from Object.prototype are no longer included in autocomplete results.
Parser:
Fix parsing of for await (async of ...) (regressed in 0.197.0)
Fix parsing of for (let in x) in non-strict mode
Fix parsing of class fields named static
Fix missing parse errors on keywords containing escape sequences (regressed in 0.180.0)
Fix missing parse error when using await as a parameter in an async arrow function
Fix missing parse error for export { ReservedWord as ... }
Fix incorrect parse error on export * as ReservedWord from ..., which is now allowed
Treat && and || as tokens when parsing types to improve error messages
Parse the argument of the typeof type argument as a value, not a type, as it is a value
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps flow-parser from 0.195.2 to 0.198.1.
Release notes
Sourced from flow-parser's releases.
... (truncated)
Changelog
Sourced from flow-parser's changelog.
... (truncated)
Commits
1e7955d
v0.198.1b0d54fb
fix VisitorsRuntime.StructuralMismatch exception0f9a755
v0.198.01dc2274
handle intersections as static class calleesc51022a
restore errors properly inin_sandbox_cx
859bc5f
refactor: flatten out PolyT cases in Flow_jsfe87b8f
[ts-syntax] Quick fix to convertreadonly
on array/tuple type syntax to app...66a3d98
[ts-syntax] Parse and error onreadonly
applied to tuple and array type syntaxeb54ab5
[ts-syntax] Treatreadonly
as a token when parsing typesba2b5f3
[ts-syntax] Add more parser tests forreadonly
varianceDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)