Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS/Flow] Implicit return values break syntax highlighting when < or > used in type definitions #255

Open
TomasBarry opened this issue Aug 3, 2020 · 0 comments

Comments

@TomasBarry
Copy link
Contributor

When defining methods where the types have a < or a > (Array<...> or any Flow utility type) and that method implicitly returns a value the syntax highlighting breaks down. Take the following simple example:

// @flow

const someMethod = (params: Array<string>): Array<string> => params

console.log('some console')

The syntax highlighting breaks down after the implicit return of `params. However, if the above was defined as:

// @flow

const someMethod = (param: string): string => params

console.log('some console')

The syntax highlighting remains intact.

The first example can be fixed by using the long-form with an explicit return:

// @flow

const someMethod = (params: Array<string>): Array<string> => { return params }

console.log('some console')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant