dsherret / dsherret/ts-morph

Support the following features within the "formatting" module

Open
#1,463 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
6.2k
Forks
238
Avg merge
2m
Merged PRs (30d)
1

Description

**Is your feature request related to a problem? Please describe.**
No.

**Describe the solution you'd like**
While trying to format a TS source file, the [formatter](https://ts-morph.com/manipulation/formatting) module supports a bunch of options such as default indentation width, trimming trailing white-spaces etc. I would love to see support for additional options. 2 in particular that I have in mind currently are:
1. Introduce new-line after every semi-colon.
2. Replace double-quotes with single-quotes for all the string literals.

**Describe alternatives you've considered**
1. I tried the Typescript API's emitter/printer module and found that its purpose is not geared towards formatting source files. More context [here](https://github.com/microsoft/TypeScript/issues/56141).
2. Using transformation to achieve the same thing - I have considered this but not sure if this will be an elegant solution if we have a library doing something similar already that I can leverage.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.