Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Have formatter insert newlines around multi-line expressions

Aberta
#8,960 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@rolandpeelen já está trabalhando nisso.

Desde 22/10/2026.

  • #8961 de @rolandpeelen — aberto

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
25/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
ocaml
Domínio
tooling

Direção de pesquisa

Start by reviewing the linked draft pull request #8961 to see the formatter approach and the files or tests it touches. Then trace how the formatter handles whitespace around multi-line expressions and compare the output with the example in this issue. Done when formatting adds consistent whitespace around multi-line expressions and the relevant formatter tests pass.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

  module Details = {
    @react.component
    let make = (~input as {filePath}: input) => React.string(filePath)
  }
  module Body = {
    @react.component
    let make = (~input as {filePath, oldString, newString, replaceAll}: input) => <>
      <ToolView.Field label="file" value=filePath />
      <ToolView.Text
        label={replaceAll->Option.getOr(false) ? "replace all" : "replace"} text=oldString
      />
      {newString == ""
        ? <ToolView.Field label="with" value="(nothing)" />
        : <ToolView.Text label="with" text=newString />}
    </>
  }
  module Output = Tool.TextResult.Output
  let failed = Tool.TextResult.failed

It seems that some AIs love writing very dense code, and it makes things rather unreadable. It would be amazing if we could print in a way that adds white-spacing / makes the formatting consistent. Just like we remove double white-spacing in the formatter

I have a draft PR (vibed) here: https://github.com/rescript-lang/rescript/pull/8961

Linguagem predominante
OCaml
Estrelas
7.5k
Forks
483
Merge médio
19h 35min
PRs com merge (30d)
208

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de rescript-lang/rescript

Todas as issues de rescript-lang/rescript

Issues semelhantes

Mais issues de DevTools

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.