0.2.0 • Published 4 years ago

prettier-plugin-reasonml v0.2.0

Weekly downloads
337
License
MIT
Repository
-
Last release
4 years ago

Prettier ReasonML plugin

Wrapper plugin adding refmt support to Prettier. This brings *.re files support to Prettier and allows you to format those files like you would the rest of your codebase, while also inheriting the configured Prettier options. This follows the same model as the Elm plugin in that the code to format is passed directly to refmt and isn't transformed into an AST, the goal of this package is to simply integrate refmt more smoothly into your workflow if you already use Prettier.

Installation

npm install prettier prettier-plugin-reasonml -g # or
yarn global add prettier prettier-plugin-reasonml

Usage

All you need to do is use Prettier on ReasonML files like you would any other files:

prettier src/**/*.re --write --print-width 120

VSCode plugin support is currently blocked by this issue.

Using other refmt binaries

If refmt is not in your path or you wanted to use bsrefmt, set the environment variable REFMT_BIN

REFMT_BIN=bsrefmt prettier src/**/*.re --write --print-width 120

Credits

This is largly inspired by prettier-plugin-elm so props to them.