picostitch
crafting (and) JavaScript

Learning ReScript - Part 3 (Format, Start Typing)

The setup is working, I can compile and run ReScript files, I touched a bit on the syntax in Part 2, next I will continue through the docs chapters from top to bottom.

ReScript docs TOC
ReScript docs TOC

Contents

  1. Formatting
  2. First Type Annotations
  3. Type Alias
  4. Retrospective #1
  5. An Opinion on the Docs
  6. To be Continued ...

Formatting

I remember having heard on the podcast with Patrick Ecker that ReScript comes with a formatting tool (just like golang, or many of the newer languages), which prevents discussions about code layout, cool. Now it's time to apply it, the hello world code is growing, it needs some proper styling.

After rescript -h (remember, not --help!) I figured out it is rescript format. Alright. I run rescript format, nothing happens. So I have to pass the filename explicitly. Sad. Ok, rescript format src/hello.res works fine. It took me a while to read the rescript format -h help page properly to figure out that