question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flow call expression generic with union type is parsed incorrectly with babylon parser

See original GitHub issue

Prettier 1.15.2 Playground link

Input:

const Theme = React.createContext<"light" | "dark">("light");

Output:

const Theme = (React.createContext < "light") | ("dark" > "light");

Expected behavior:

const Theme = React.createContext<"light" | "dark">("light");

This seems pretty bad.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ikatyangcommented, Nov 24, 2018

How about adding a babylon-flow parser (and babylon-typescript for TS)?

0reactions
j-f1commented, Nov 23, 2018

Should Prettier add an option to enable all: true for the Babylon parser?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parsing error when calling generic function with type arguments
The first time I saw this error, my first impression was that I forgot to import XType , so I scrolled to the...
Read more >
eslint-plugin-flowtype - npm
This plugin exports a recommended configuration that enforces Flow type good practices. To enable this configuration use the extends property in ...
Read more >
CustomAction/RNCustomAction/node_modules/eslint-plugin ...
Install babel-eslint parser (ESLint parser does not support type annotations). ... This plugin exports a recommended configuration that enforces Flow type ...
Read more >
@babel/plugin-transform-flow-comments | Yarn - Package Manager
@babel/plugin-transform-flow-comments. owner babel21.1kMIT7.19.0 vulns 0 vulnerabilities. Turn flow type annotations into comments. babel-plugin ...
Read more >
pDi - River Thames Conditions - Environment Agency - GOV.UK
Zeekant 40 den haag, Selection of cables pdf, Zakelijke brief geachte dhr, Studio type apartment decorating ideas? Turin horse quotes? Image family room!...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found