tools
tools copied to clipboard
☂️ Formatter 0.9.0
Description
This is an umbrella issue for the work on the Formatter for the 0.9.0 release.
Goals
- Rome removes unnecessary parentheses and adds parentheses to improve readability.
- Improve Prettier compatibility of some core syntax nodes.
Tasks
- [ ] Parentheses (2 weeks) #2427
- [ ] Implement parentheses handling for expressions #3057, #3079 #2449
- [ ] Implement parentheses handling for assignments
- [ ] Implement parentheses handling for types
- [ ] Prettier compatibility (2 weeks)
- [x]
JsConditionalExpression - [x] Hug function parameters
- [x] Parameter and return type formatting
- [x] return and throw argument
- [x]
JsTemplate#2446 #3063 - [ ]
JsBinaryExpression#3079 - [ ]
JsArrowFunctionExpression - [ ]
JsCallArguments - [ ]
CallExpression(Member Chain) - [ ]
JsStaticMemberAssignmentandJsComputedMemberAssignment#3061
- [x]
This is a follow up question after https://github.com/rome/tools/pull/3057.
Is there a specific reason why the "needs parentheses" information is tracked inside the formatter phase?
Have you considered some other solutions, such as a visitor approach, or even computing this information during the parsing phase and storing it inside our green tree?
I would like to know what are the implications of your decisions in the future developments
@ematipico I replied on the PR as these questions seem relevant to the implementation.
I start working on the Arrow function formatting
I'll start looking into JSX formatting tomorrow
We are getting close to 90% prettier compatibility, that's awesome.