github-linguist / github-linguist/linguist

Flow

Open
#7,156 0 comments 1 reaction 0 assignees View on GitHub
Add Language Good First Issue
Dominant language
Ruby
Stars
13.7k
Forks
5.4k
Avg merge
1d 15h
Merged PRs (30d)
17

Description

## Language name

[Flow](https://flow.org/)

## URL of example repository

Flow's website code has some example `.js` files (bad file name extension, I know, but maybe with more support like in this feature request, they might be more inclined to add a unique extension) that use Flow syntax:

https://github.com/facebook/flow/blob/d41d9956a6de8a1ab5fce696d67f23158b1e87c9/website/src/js/parser-playground.js

## Most popular extensions

IDE extensions? Here's the extension for VS Code:

https://marketplace.visualstudio.com/items?itemName=flowtype.flow-for-vscode

## Detected language

Not sure. Here's sample of code:

```
class A {
foo: {...} | null = {any: 'thing'}

someMethod(options: ?{[string]: mixed}): A {
return new A
}
}
```

## URL of syntax highlighting grammar

Here's one:

https://github.com/facebook/flow/blob/main/website/src/try-flow/flow-grammar.json

The [Flow playground](https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+h46fNRLuKxJIGWh8MeT0ZfhYlCStpHzNsFBAMIQkIEQwJODAQfiEyfBE4eWw2fDgofDBMsAALfAA3KjgsXGxxZC4eAw0G-GhcWn9aY3wWZldu-g1mbGqJUoBaCRHEzrcDEgBrbAk62kXhXFxJ923d-cPRHEpTgyEoMDaqZdW7vKgoOfaSKgOKpqmDA+d4gB5fMA-P6LCCMLLQbiLOoYCqgh6-GDYRYIXYLSgkRZkCR4jpddwPfJLZjpOBkO4AX34kA0SSeGBIJAABABBTnAAA6UE5ws5MGIyD5Vil9M5AB9OUdcJyALx84G0CUAcgktQqCE19MFgpFnJI6WwAFldrUIGwABSw+F2CUAfmAAG17KYoAgALoSoolNj0gCUEt5AqFJpFLAkQkoQq+AHcecaRYaoPTciAGiYSHBoEkGgAGKwAJgArBWrMWQPSgA) shows the AST for the previous example.

Here's the [same example on AST Explorer](https://astexplorer.net/#/gist/7ebfbc409188a0609f0fd378b0c1adb7/0aff0b2b4f379372c4271291633373b684b2863e), under "JavaScript" which admittedly is a little odd because it isn't JavaScript. I hope they can [consider a new default file extension](https://github.com/facebook/flow/issues/4233) and migrate away from `.js` because the downsides are notable.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.