facebook / facebook/flow

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

Offen
#4,235 0 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
22.3k
Forks
1.9k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.