prettier/tests
Christopher Chedeau d0bc2991f6 Reimplement MemberExpression printing (#469)
There are currently three issues related to suboptimal rendering of MemberExpression chains. The previous implementation was trying to flatten only a single group at the same time, but it didn't work well because we didn't have the full context to be able to make decisions.

In this implementation, I'm going through the entire chain at the same time and group it into logical units and make decisions based on this. It solves all the problems I can think of and if we need to tweak it in the future, it should be easy.

Fixes #268
Fixes #212
Fixes #21
2017-01-31 12:32:42 -08:00
..
array_spread Move tests around (#454) 2017-01-24 14:35:37 -08:00
arrays Move tests around (#454) 2017-01-24 14:35:37 -08:00
arrows Simplify arrow functions that use blocks (fixes #268) (#496) 2017-01-27 13:39:17 -05:00
async Move tests around (#454) 2017-01-24 14:35:37 -08:00
binary-expressions Move tests around (#454) 2017-01-24 14:35:37 -08:00
bracketSpacing Fix range for object newline detection (#520) 2017-01-30 09:54:19 -08:00
break-calls Break nested calls (#517) 2017-01-31 11:45:47 -05:00
class_extends Do not put a newline on empty `{}` for functions (#447) 2017-01-24 12:37:01 -05:00
classes Add break points for class declaration (#466) 2017-01-25 16:36:55 -05:00
comments Reimplement MemberExpression printing (#469) 2017-01-31 12:32:42 -08:00
computed_props Move tests around (#454) 2017-01-24 14:35:37 -08:00
decorators Put decorators on the same line (#459) 2017-01-25 16:30:09 -05:00
directives Do not always put an empty lines after directives (#505) 2017-01-30 09:10:54 -08:00
dynamic_import Support printing import("a") (#458) 2017-01-25 07:33:48 -08:00
empty_statement Make sure empty for loops generate valid code (#224) 2017-01-16 12:54:39 -05:00
es6modules Move tests around (#454) 2017-01-24 14:35:37 -08:00
export Fix bracketSpacing typo in tests (#299) 2017-01-18 12:22:12 -08:00
export_default Move tests around (#454) 2017-01-24 14:35:37 -08:00
export_extension Fix export extension output (#361) 2017-01-20 19:20:31 -08:00
exports Move tests around (#454) 2017-01-24 14:35:37 -08:00
flow Reimplement MemberExpression printing (#469) 2017-01-31 12:32:42 -08:00
for Added parens around in operator in for loops 🚀. (#468) 2017-01-25 14:24:25 -08:00
function Move tests around (#454) 2017-01-24 14:35:37 -08:00
import Support multiple standalones in import (#389) 2017-01-22 12:34:00 -08:00
interface Fix range for object newline detection (#520) 2017-01-30 09:54:19 -08:00
jsx Indent ternaries (#484) 2017-01-26 11:58:40 -08:00
jsx-multiline-assign Move tests around (#454) 2017-01-24 14:35:37 -08:00
jsx-newlines [JSX] Handle each line of text separately, allow up to one extra newline (#455) 2017-01-27 14:20:01 -05:00
jsx-significant-space Move tests around (#454) 2017-01-24 14:35:37 -08:00
jsx-split-attrs Don't break up JSXOpeningElement if it only has a single text attribute (#488) 2017-01-26 17:22:56 -05:00
jsx-stateless-arrow-fn Indent ternaries (#484) 2017-01-26 11:58:40 -08:00
jsx_escape Introduce --parser/parser option and deprecate --flow-parser/useFlowParser (#342) 2017-01-19 14:35:12 -08:00
label Fix empty labels (#383) 2017-01-22 12:34:27 -08:00
last_argument_expansion Reimplement MemberExpression printing (#469) 2017-01-31 12:32:42 -08:00
line Move tests around (#454) 2017-01-24 14:35:37 -08:00
literal Print \x and \u escapes in strings and regexes lowercase (#522) 2017-01-31 06:56:26 -08:00
member Indent computed member (#471) 2017-01-26 14:58:47 -05:00
method-chain Reimplement MemberExpression printing (#469) 2017-01-31 12:32:42 -08:00
new_expression Fix cases of missing parens with NewExpression (#230) 2017-01-15 23:56:40 -05:00
object-prop-break-in Fix range for object newline detection (#520) 2017-01-30 09:54:19 -08:00
object_colon_bug Remove extra group when printing object values (#502) 2017-01-30 10:03:40 -05:00
objects Fix range for object newline detection (#520) 2017-01-30 09:54:19 -08:00
optional-type-name Fix range for object newline detection (#520) 2017-01-30 09:54:19 -08:00
preserve_line Preserve next line with trailing comment (#535) 2017-01-31 11:27:44 -05:00
quotes Refactor comment algorithm and improve newline/spaces detection (fixes #483, #275, #135, #78, #36) (#482) 2017-01-26 11:57:43 -08:00
rest Don't print trailing commas for object destructuring and rest (#512) 2017-01-30 10:07:03 -05:00
shebang Do not put a newline on empty `{}` for functions (#447) 2017-01-24 12:37:01 -05:00
strings Preserve next line with trailing comment (#535) 2017-01-31 11:27:44 -05:00
switch Move tests around (#454) 2017-01-24 14:35:37 -08:00
tabWith Do not put a newline on empty `{}` for functions (#447) 2017-01-24 12:37:01 -05:00
template Move tests around (#454) 2017-01-24 14:35:37 -08:00
ternaries Fix range for object newline detection (#520) 2017-01-30 09:54:19 -08:00
trailing_comma [RFC] Keep expanded objects expanded (#495) 2017-01-30 09:08:55 -08:00
trailing_whitespace Remove `multilineGroup` (#450) 2017-01-24 13:54:01 -05:00
unary Move tests around (#454) 2017-01-24 14:35:37 -08:00
unary_expression Move tests around (#454) 2017-01-24 14:35:37 -08:00
unicode [RFC] Keep expanded objects expanded (#495) 2017-01-30 09:08:55 -08:00
union_intersection Move tests around (#454) 2017-01-24 14:35:37 -08:00
update_expression Fix some parens cases for UpdateExpressions (#381) 2017-01-21 20:14:22 -08:00
while Move tests around (#454) 2017-01-24 14:35:37 -08:00
windows Maintain windows line ending (#472) 2017-01-26 14:16:42 -08:00
yield Proper parenthesis for yield and await in conditional (#436) 2017-01-23 10:25:38 -08:00