reasonml / reasonml/reason

Options support in programmatic API?

Open
#2,278 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

KIND: FEATURE REQUEST
Dominant language
OCaml
Stars
10.3k
Forks
438
PR merge metrics
No merged PRs in 30d

Description

I'm trying to write a thin wrapper plugin for Prettier, like what they're doing with prettier-plugin-elm and elm-format. For this I'm using the programmatic API.

The plugin and formatting work there's no issue there, but the programmatic API doesn't allow passing options (since refmt reads them directly from arguments) which means I can't pass the configured print width from prettier to refmt even though it supports it. Could an options argument be added to the print* functions maybe?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the programmatic API's print* functions and inspect how refmt currently receives options from arguments. Trace how a wrapper plugin could pass the configured print width, then verify that the API accepts options and preserves existing formatting behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, ocaml
Domain
api, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.