Microsoft/TypeScript

Support column limit in formatter

Aberta

#1.988 aberto em 9 de fev. de 2015

 (7 comentários) (0 reação) (0 responsável)TypeScript (13.395 forks)batch import
Help WantedSuggestion

Métricas do repositório

Stars
 (108.860 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

Currently, running the formatter (eg via the compiler API: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#pretty-printer-using-the-ls-formatter) produces code which is arbitrarily wide, for statements which are nested, complex, etc.

Our style guide requires a maximum columns, which means the formatter should take a configuration for how wide this is. Line breaks should probably be added at the highest point in the AST on the long line.

Guia do colaborador