Neomake: JavaScript Flow error format changed

Created on 27 Jul 2017  路  7Comments  路  Source: neomake/neomake

Between version 0.50.0 and 0.51.0 of Flow, the error message format changed from:

lib/foo.js:8
  8: Math.abs('1');
              ^^^ string. This type is incompatible with the expected param type of
160:     abs(x: number): number;
                ^^^^^^ number. See lib: /tmp/flow/flowlib_1554b810/core.js:160

to:

Error: lib/foo.js:8
  6: Math.cos('1');
              ^^^ string. This type is incompatible with the expected param type of
171:     cos(x: number): number;
                ^^^^^^ number. See lib: /tmp/flow/flowlib_1b834bba/core.js:171

E.g., they added Error: to the front of the message.

I got stuff working by change the errorformat to:

%E%*[Error: ]File "%f"\, line %l\, characters %c-%m,%C%m,%Z%m
bug

All 7 comments

Thanks for the report and suggested fix.

There is likely something better than %*[Error: ] for this though; need to look it up.

Probably, I have literally no idea what I'm doing. I just typed until something was reported again.

Nobody said 'errorformat' was sane.. ;)

Can you provide the example output using --from=vim --show-all-errors, please?

btw: if you're interested in improving the maker, here are references to what Syntastic (https://github.com/vim-syntastic/syntastic/blob/e1161a723a353db99780f9a9351340df7abbb106/syntax_checkers/javascript/flow.vim#L31) and ALE (https://github.com/w0rp/ale/blob/master/ale_linters/javascript/flow.vim) do.

ALE for example also uses --respect-pragma (based on a version check).

Hi sorry for not testing. Thanks for sorting/merging this. I'll take a look at the Syntastic version as a little sunday project. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cycomanic picture cycomanic  路  3Comments

kevinsjoberg picture kevinsjoberg  路  8Comments

nhooyr picture nhooyr  路  6Comments

mcnelson picture mcnelson  路  4Comments

RenatoUtsch picture RenatoUtsch  路  4Comments