rescript-lang / rescript-lang/rescript-vscode

Formatting res file with embedded JS keeps adding newlines

Open
#823 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
ReScript
Stars
354
Forks
63
Avg merge
11h 29m
Merged PRs (30d)
1

Description

If I embed JS in res files and format the code, then it keeps increasing number of newlines between code every time I format (format on save).

image

Contributor guide

Open the contributing guide

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

Start by reproducing format-on-save with embedded JavaScript in a ReScript file and observe the newline changes across repeated formatting runs. Trace the formatter integration to identify where the output becomes non-idempotent; done means formatting the same file repeatedly no longer adds newlines.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.