Open cameronhimself opened 8 years ago
I just tried it and I could not reproduce the error. My best bet is that you've run into the same issue where the linter has problems detecting the flow comment correctly.
The other possibility:
Currently linter-flow
uses flow check-contents
to check for unsaved files, and thus gets changes for the currently open file. When the current file is saved, it uses flow status
to get all the errors in the project.
It's possible that flow status
is just taking too long and all you're seeing is a delay.
So it turns out that this is the behavior I see for a file that does not have the // @flow
comment at the top. When I add the comment, everything works as expected.
So I guess this issue report is now about how flow is enabled for unsaved files even when the comment tag is not present. My .flowconfig
file is empty (no changes made to it after flow init
).
This was regression in v5.0.0 where the detection for the @flow
comment was broken.
// @flow
is ignored
/* @flow */
is accepted.
If there is no inline comment in the file, it would incorrectly assume the comment exists.
Fixed in #80
Should be fixed in 5.1.0
My colleagues and I are still seeing the behaviour seen in the original issue, with the same steps to reproduce. I tried changing the flow comment, however, none seems to work as expected. I am on 5.1.0, atom 1.7.2 osx 10.11.1, with linter 1.11.4 here is a file that displays this behaviour:
// @flow
const foo: number = '';
@cameronhimself or @anthillape are either of you still experiencing this issue with v5.5.0?
I'm experiencing the bug as of right now, with version 5.5.0. I get hints both as tooltip and in the bottom area in an unsaved file, but they are gone as soon as I save the file.
This issue occurs whether or not I have linter-eslint enabled, which also reports to the same areas.
I tried it with both/* @flow */
and // @flow
I'm running Atom 1.13.0, flow-bin 0.37.4 and linter-flow 5.5.0
This bug is probably a bug with flow itself. Longer-flow uses flow status for saved files. But it uses a different command for unsaved files. That could be causing the problem. Nuclide fixes this problem by only showing you errors after you save the file. Would you prefer that?
I'd prefer linter-flow to behave like linter-eslint, and I'd prefer to use linter-flow instead of dealing with a second "type" of plugin, hah.
I haven't checked out nuclide, or any other particular flow linters.
Eslint, IIRC, evaluates the files on save and displays errors afterwards, which I'd prefer.
@emiljohnsen eslint works on the fly too. There's an option though. I'll try and make it work with that option.
Steps to reproduce (for me, anyway):
Atom, my flow binary, and this plugin are all up to date (1.6.0, 0.22.1, and 5.0.0 respectively). Mac OS X 10.9.5.