flow-js2-mode icon indicating copy to clipboard operation
flow-js2-mode copied to clipboard

`void` primitive type causes parse error

Open ozanmakes opened this issue 8 years ago • 1 comments

First of all, thank you for creating this project! I think it's the last piece of the puzzle for making Emacs the perfect development environment for React + Flow!

I've hit a few parsing issues keeping me from using modes that use JS2 mode AST such as https://github.com/magnars/js2-refactor.el, and would like to bring them to your attention.

First one is regarding the void primitive type clashing with the void operator (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void) and resulting in a parser error:

// @flow

type Props = {
  foo: () => void,
  bar: () => void
};

function method(str: string, bool?: boolean): void {
  // ...
}

ozanmakes avatar Nov 28 '17 09:11 ozanmakes

Thanks for all the reports! I'm fixing things as I come along the issues but my Flow usage is very basic (what I'm now working on is my first js/node project ever :D), so this is very helpful.

If you come along more issues do not hesitate to report them, if only to have a more complete look at how much work is left to do.

The code is quite a mess now, it's mostly code glued from various other projects :D So there's not yet much direction. But we are moving forward!

Fuco1 avatar Nov 28 '17 09:11 Fuco1