Closed Bug 1620556 Opened 8 months ago Closed 7 months ago

Upgrade Prettier to 1.19.x

Categories

(Firefox Build System :: Lint and Formatting, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: standard8, Assigned: Mardak)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Prettier 1.19.x has support for nullish coalescing and Optional chaining:

https://prettier.io/blog/2019/11/09/1.19.0.html

Once we've done the smaller update to 1.18.x (bug 1620218), we should look at doing this slightly larger update - the main difference I think is that nested array/object formatting has changed.

Blocks: 1560186

Note that upgrading prettier will require a reformat of the entire tree:

We recommend pinning an exact version of prettier in your package.json as we introduce stylistic changes in patch releases.

I suspect this is fine, but is probably something we want to take into account. CCing vporof for his thoughts...

(In reply to Dan Mosedale (:dmose, :dmosedale) from comment #1)

Note that upgrading prettier will require a reformat of the entire tree:

As we're already on prettier, this isn't a massive reformat. So this is no more extensive than running ./mach eslint --fix, and passing the result through try.

I need to take another look, but I'm pretty sure that although there's a reasonable amount of changes, we probably don't need tree-closing for this. Maybe just landing in a quiet spot.

This is what I was referring to with "the main difference I think is that nested array/object formatting has changed.".

Looks like there's more files touched in this latest update but fewer lines affected(deleted) than the previous update from bug 1620218:

1.17.0 -> 1.18.2
 232 files changed, 419 insertions(+), 1226 deletions(-)

1.18.2 -> 1.19.1:
 357 files changed, 2630 insertions(+), 1124 deletions(-)

The previous update generally consolidated multiline strings (3 lines into 1) while this update is mostly what standard8 mentioned in comment 0 with nested expansion plus some changes to not needing parens for same-operator expressions.

Blocks: 1617959
See Also: → 1620218
Assignee: nobody → edilee
Status: NEW → ASSIGNED

Depends on D66128

Pushed by elee@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/50d4048d635e
Automatic code fixes for Prettier 1.19.1 upgrade. r=Standard8,remote-protocol-reviewers,marionette-reviewers,webcompat-reviewers,perftest-reviewers,sparky,whimboo,denschub
https://hg.mozilla.org/integration/autoland/rev/4c201c81234a
Update Prettier to 1.19.1. r=Standard8

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/73dac954fb5b
comm-central automatic code fixes for Prettier 1.19.1 upgrade. rs=eslint

Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Regressions: 1622519
Regressions: 1622521
No longer regressions: 1622521
See Also: → 1622521
No longer regressions: 1622519
See Also: → 1622519
Regressions: 1629910
No longer regressions: 1629910
You need to log in before you can comment on or make changes to this bug.