I have this code:
var loadTempImpersonationToken = (username: string): Promise => client({
uri: `endpoint`,
cache: false
})
As you can see, this includes both an arrow function, and flow type annotations. Babel supports arrow functions (in the es2015 & stage-0 presets) as well as stripping type annotations, in the react preset.
Simply combining the presets fails:
{"presets": [
"stage-0",
"react"
]}
Produces
Error: Parse Error: Line 1: Unexpected token : while parsing file: /Users/tmcw/src/example.js
How does one support these features in the same code?