facebook / facebook/flow

Renaming a file with flow errors, changing only its case, leaves errors behind associated with old file name

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

Description

The basic issue is that after running flow and finding errors in a file, renaming that file in a way that only changes the case of the filename can leave you stuck with those errors.

To reproduce:
1) Create a file Multiply.js
```
// @flow
const multiply = (x, y) => {
return x * y;
};

multiply(2, 3);
multiply(4, "five");
```
2) Run flow to see error
```
Multiply.js:3
3: return x * y;
^ string. The operand of an arithmetic operation must be a number.
```
3) Change the file name, case-only, to multiply.js
4) Run flow again, which results in errors reported for both the old and new names
```
Multiply.js:3
3: return x * y;
^ string. The operand of an arithmetic operation must be a number.

multiply.js:3
3: return x * y;
^ string. The operand of an arithmetic operation must be a number.
```
5) Delete multiply.js
6) Run flow again, which continues to show the error for Multiply.js even though it doesn't exist anymore
```
Multiply.js:3
string. The operand of an arithmetic operation must be a number.
```

At this point, you can get the error to go away by creating an empty Multiply.js file and running flow again, but I couldn't find any other way in the docs to clear what flow had remembered about errors in this file.

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.