Class Member Ordering (TypeScript/Flow) #5412
Labels
locked-due-to-inactivity
Please open a new issue and fill out the template instead of commenting.
type:question
Questions and support requests. Please use Stack Overflow for them, not the issue tracker.
Prettier 1.15.1
Input:
Output:
Same as the input.
Expected behavior:
There is a more-opinionated way to define the order of class members. For example, a more readable output is: (Statics First; see below)
However, there are a variety of ways for how class members should be sorted... (by access level, by method vs property vs constructor, combinations of those, etc.). In keeping with Prettier's opinionated Option Philosophy, these members should be ordered in a defined way if not configurable. However, TypeScript's TSLint rule
member-ordering
gives three ways:I understand that there may be conflicting opinions on these orders, but it is simply important for Prettier to specify a single, opinionated way that members should be ordered. The less configuration, the better, and providing options here defeats the purpose of Prettier. Nevertheless, whether or not class member formatting should be optional or required is another point to consider, and so is the treatment of computed getters as fields or as methods.
The text was updated successfully, but these errors were encountered: