facebook / facebook/flow

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

Aperta
#4,235 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
22.3k
Fork
1.9k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.