facebook / facebook/flow

The flow-upgrade tool deletes comments between class definition and props declaration

Open
#5,608 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Bug: The `flow-upgrade` tool deletes comments between class definition and props declaration.
Version information:
```
grep flow-upgrade package.json
"flow-upgrade": "^1.0.4",
```

To reproduce this behaviour, create the following file:
```
/* @flow */
import React from 'react';
export class CviBiomarkerFactId extends React.PureComponent {
/** Some comment I want to keep here. */
props: {
id: string,
ui_label?: string,
};
}
```
then run `yarn create flow-upgrade`, which will result in the following file:
```
/* @flow */
import * as React from 'react';
export class CviBiomarkerFactId extends React.PureComponent<{
id: string,
ui_label?: string,
}> {}

```
Note that it ate the comment.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.