Hi all! I’m fairly new to the ecosystem and have noticed that ReScript auto formats and doesn’t provide a way to configure the resulting formatting.
Is ReScript forever locked into this no-configuration mindset regarding formatting? I’m sure other people besides myself would appreciate having some options. I know having One Way to format is appealing for the standardization-across-codebases reason but to help make ReScript more inclusive, it’d be great to give developers some flexibility. Not everyone finds everything equally readable.
For myself, I’d love to be able to do something like this:
let add : (int, int) => int = (a, b) => a + b
It’s a bit like how languages like PureScript handle types:
add :: Int -> Int -> Int add a b = a + b
For myself it’s more readable than how it currently auto-formats:
let add: (int, int) => int = (a, b) => a + b
And I’m well aware that I can do this:
let add = (a: int, b: int): int => a + b
But, for me, I have a hard time parsing the text when types and parameters are mixed in together so I prefer the previous methods for writing out types. Especially with more complicated functions.
The best option for me at the moment is this:
type add = (int, int) => int let add: add = (a, b) => a + b
But it’s repetitive and more boilerplate.
Thanks for reading this!