-
-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Formatter): add space inside option #4605
base: main
Are you sure you want to change the base?
Conversation
@sirreal would you mind creating a task first? Or an umbrella issue? This isn't something that we might be able to ship in one PR, there's a lot of stuff to take into account:
|
Sure, thanks. I've created #4607. This PR really a placeholder and I have a number of questions of my own after spending just a bit of time on this 🙂 |
CodSpeed Performance ReportMerging #4605 will not alter performanceComparing Summary
|
I'd love to see this be slightly more configurable, though, as I find that spaces inside brackets actually reduces readability, for example:
is much more readable however:
actually feels less readable. I think in terms of accessibility, the square brackets thing is huge, but the round brackets part is contentious. another rule we used to have is actually spaces after function names:
makes skimming over code much easier as you can easily see the difference between declaration and call |
@antony please open an RFC or an issue. For us, a PR isn't a place to debate/bikeshed possible configurations, it's mostly about discussing technical decisions. I asked interested parties to create an RFC, but no-one has done that. |
WIP
Summary
Add formatting option to include spacing inside parentheses, square brackets, curly braces, and angle brackets.
For example, this input:
Would be formatted as follows with a "space inside" option enabled:
See #2360 (comment).
Closes #4607 (eventually).
Test Plan