Skip to content

Conversation

thorn0
Copy link
Member

@thorn0 thorn0 commented Feb 3, 2021

Description

A take on #2482

Checklist

  • I’ve added tests to confirm my change works.
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@thorn0 thorn0 force-pushed the assignments branch 2 times, most recently from 2805616 to e94cc2a Compare February 3, 2021 03:50
@thorn0 thorn0 linked an issue Feb 3, 2021 that may be closed by this pull request
@thorn0 thorn0 force-pushed the assignments branch 4 times, most recently from b5957b8 to 719746a Compare February 3, 2021 11:15
@thorn0 thorn0 mentioned this pull request Feb 3, 2021
4 tasks
@thorn0 thorn0 force-pushed the assignments branch 4 times, most recently from e3da2b2 to 3b26905 Compare February 4, 2021 11:45
@thorn0 thorn0 linked an issue Feb 4, 2021 that may be closed by this pull request
@thorn0 thorn0 mentioned this pull request Feb 4, 2021
4 tasks
@thorn0 thorn0 force-pushed the assignments branch 2 times, most recently from 6a5214d to 97b9b70 Compare February 6, 2021 12:52
@thorn0 thorn0 marked this pull request as ready for review February 7, 2021 03:07
@thorn0 thorn0 changed the title Experiments with assignments Format assignments more consistently Feb 7, 2021
@thorn0 thorn0 force-pushed the assignments branch 2 times, most recently from f5b8014 to adff4ac Compare February 7, 2021 13:18
@thorn0 thorn0 added this to the 2.3 milestone Feb 11, 2021
@thorn0 thorn0 linked an issue Feb 11, 2021 that may be closed by this pull request
@thorn0 thorn0 linked an issue Feb 11, 2021 that may be closed by this pull request
2 tasks
var numberValue2_renamed2 = require("ES6_ExportFrom_Intermediary2")
.numberValue2_renamed2;
var numberValue2_renamed2 =
require("ES6_ExportFrom_Intermediary2").numberValue2_renamed2;
Copy link
Member

@alexander-akait alexander-akait Feb 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid we will get a lot of issues on this, but for me it looks very good, better, so I am 👍 on it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think many people prefer to have that property on a separate line? We'll see.

I'm done with this PR, BTW. What do you think about the rest of the changes? If you approve it (or somebody else), I'll merge it today.

@thorn0 thorn0 merged commit 0a647a0 into prettier:main Feb 16, 2021
@thorn0 thorn0 deleted the assignments branch February 16, 2021 19:25
a:
a(),
b:
[],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look broken?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's beyond printWidth. If the names of the keys were longer, it wouldn't look that bad. Special handling for short keys is a separate open issue: #3711

function Bar() {
throw new Error("Internal error: Illegal constructor");
}
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor but also looks unintended?

Copy link
Member Author

@thorn0 thorn0 Feb 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to improve in the future. The idea was to format type assertions similarly to function calls while preserving at the same time the usual behavior of comments in Prettier. If a comment is on its own line, Prettier doesn't change that. But now I see that the behavior of the parens could depend on this condition (whether the comment is own-line) too.

@thorn0 thorn0 mentioned this pull request Apr 11, 2021
3 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants