[flow-remove-types] Output is corrupted by \u2019 characters
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Flow version: 2.106.3 (flow-remove-types).
Note that I'm not entirely clear how the version of `flow-remove-types` is coupled to `flow`.
## Expected behavior
Flow syntax is removed.
## Actual behavior
Most flow syntax is removed, but at this character, the output gets corrupted.
## Example
```javascript
const flowRemoveTypes = require('flow-remove-types')
const contents = `
// @flow
import React, { Component } from 'react'
export const ComponentA = () => (
)
export const ComponentB = () => (
)
type Props = {|
name: 'example'
|}
class ExampleComponent extends Component {
constructor(props: Props) {
super(props)
this.state = {
foo: 'bar',
}
}
render() {
return (
)
}
}
export default ExampleComponent
`
const removed = flowRemoveTypes(contents, { pretty: true }).toString()
console.log(removed)
```
Expected output:
```javascript
//
import React, { Component } from 'react'
export const ComponentA = () => (
)
export const ComponentB = () => (
)
class ExampleComponent extends Component {
constructor(props) {
super(props)
this.state = {
foo: 'bar',
}
}
render() {
return (
)
}
}
export default ExampleComponent
```
Actual output:
```javascript
//
import React, { Component } from 'react'
export const ComponentA = () => (
)
export const ComponentB = () => (
)
typeass ExampleComponent extends ComponentFoo
)
}
}
export default ExampleComponent
```
Contributor guide
Assessment
This issue has not been assessed yet.