Any tool like prettier for rescript

I want to enforce a consistent code style by automatically formatting code according to a predefined set of rules as a pre commit hook. Is there any code formatter for it?

ReScript has a built-in (and unconfigurable) pretty printer. What IDE/Editor do you use? VS Code should format on save by default.

EDIT: Provided you install the official extension for VS Code, that is. And don’t disable format on save.

1 Like

$ rescript format -all

You can also add the -check flag

4 Likes