Comment types of Flow makes Prettier confused
See original GitHub issuePrettier 1.15.1
Sorry, I could not reproduce it on v1.15.2 playground. 🙇 (solved at 1.15.2 ? 👀) Playground link
In flow, I can typecast with the following, not type-assertion.
Input:
type Props = {|
...$Exact<PropsWithTFn>,
...$Exact<$Call<typeof mapStateToProps, *, *>>,
...$Exact<$Call<typeof mapDispatch, *, *>>,
...$Exact<withResponse.WithQueryProps<RootQuery>>,
|};
However, this gets error message below in prettier 1.15.1
Replace `<$Call<typeof·mapDispatch,·*,·*>>` with `/*::·<$Call/*::·<typeof·mapDispatch,·*,·*>·*/>·*/`
Output:
type Props = {|
...$Exact<PropsWithTFn>,
...$Exact/*:: <$Call/*:: <typeof·mapStateToProps, *, *>*/> */
...$Exact/*:: <$Call/*:: <typeof mapDispatch, *, *>*/> */,
...$Exact/*:: <withResponse.WithQueryProps<RootQuery>*/> */,
|};
Expected behavior:
type Props = {|
...$Exact<PropsWithTFn>,
...$Exact<$Call<typeof mapStateToProps, *, *>>,
...$Exact<$Call<typeof mapDispatch, *, *>>,
...$Exact<withResponse.WithQueryProps<RootQuery>>,
|};
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Options - Prettier
Note that Prettier never unquotes numeric property names in Angular expressions, TypeScript, and Flow because the distinction between string and numeric keys ...
Read more >Code Quality Tooling with Prettier and ESLint - Wes Bos
json , create one running the command npm init by typing it into the terminal (make sure you are in the beginner-javascript folder)....
Read more >What is the difference between flow and eslint in react-native ...
Flow is a static type checker for your JavaScript code. It does a lot of work to make you more productive. Making you...
Read more >Comment Types - JavaScript. Flow
These comments allow Flow to work in plain JavaScript files without any additional work. Comment types syntax. There are two primary pieces of...
Read more >What is a Pronoun? Types of Pronouns & Examples
Using pronouns helps the flow of sentences and makes them more interesting ... Your reader would be confused and wonder who she is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@j-f1 There’re two bugs in the example:
/* :: (user.__typename: empty); */
->(user.__typename: empty);
...$Exact<PropsWithTFn>,
->...$Exact/*:: <PropsWithTFn> */,
/* :: (user.__typename: empty); */
, it works fine if there’s no/* :: (user.__typename: empty); */
Please go ahead! We appreciate PRs.