Closed Bug 1782273 Opened 2 years ago Closed 2 years ago

Enable prettier for self-hosted code

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(30 files, 1 obsolete file)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

We currently have a mix of old 4-space tabs and new 2-space tabs in self-hosted JS code. Let's enable prettier to make this more consistent.

The "prettierrc" matches almost the top-level "prettierrc", except for two changes:

  • "printWidth" is changed to 100, because we have many long lines.
  • "quoteProps" is changed to "consistent" to handle the
    sanctionedSimpleUnitIdentifiers array.

Depends on D153262

Blocks: 1782491
Blocks: sm-meta
Severity: -- → N/A
Priority: -- → P1

We've embraced clang-format for all the C++ and been happier for it. Adding some consistency to self-hosting makes for one less thing to think about when writing it, so this sounds good.

Attachment #9288320 - Attachment description: WIP: Bug 1782273 - Part 31: Remove prettier overrides. → Bug 1782273 - Part 31: Remove prettier overrides.
Attachment #9288319 - Attachment description: WIP: Bug 1782273 - Part 30: Rewrap self-hosted code at 80 columns. → Bug 1782273 - Part 30: Rewrap self-hosted code at 80 columns.
Attachment #9288319 - Attachment description: Bug 1782273 - Part 30: Rewrap self-hosted code at 80 columns. → Bug 1782273 - Part 29: Rewrap self-hosted code at 80 columns. r=tcampbell!
Attachment #9287758 - Attachment description: Bug 1782273 - Part 29: Enable prettier for selfhosted code. r=tcampbell! → Bug 1782273 - Part 30: Enable prettier for selfhosted code. r=tcampbell!
Attachment #9288320 - Attachment is obsolete: true
Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/29ba93e15767
Part 1: Apply two space indent for js/src/builtin/Array.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/48911a329fcc
Part 2: Fix whitespace in js/src/builtin/Array.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/d28d5b505b12
Part 3: Rewrap lines in js/src/builtin/Array.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/480f3be49bf1
Part 4: Remaining prettier errors in js/src/builtin/Array.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/dd16540f2123
Part 5: Apply two space indent for js/src/builtin/{AsyncFunction,AsyncIteration,BigInt,Date}.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/71fdd9221205
Part 6: Rewrap lines in js/src/builtin/{AsyncFunction,AsyncIteration,Date,Error}.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/1e5c20b1a804
Part 7: Remaining prettier errors in js/src/builtin/{AsyncIteration,Date,Error}.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/ff084083223d
Part 8: Apply two space indent for js/src/builtin/{Function,Generator,Iterator,Map,Number,Object,Promise,Reflect}.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/64885a01f4c2
Part 9: Rewrap lines in js/src/builtin/{Function,Iterator,Map,Object,Promise,Reflect}.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/38a2a58b4811
Part 10: Remaining prettier errors in js/src/builtin/{Map,Object,Promise,Reflect}.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/953af7b6e4ec
Part 11: Apply two space indent for js/src/builtin/RegExp*.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/601f77dbe7c9
Part 12: Rewrap lines in js/src/builtin/RegExp*.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/b2c80460a4ff
Part 13: Remaining prettier errors in js/src/builtin/RegExp*.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/5ab0db00d8cf
Part 14: Apply two space indent for js/src/builtin/{Set,Sorting,Tuple,Utilities,WeakMap,WeakSet}.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/9904a8855f7b
Part 15: Rewrap lines in js/src/builtin/{Set,Sorting,Tuple,Utilities}.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/f07b36c9f54d
Part 16: Remaining prettier errors in js/src/builtin/{Set,Tuple}.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/cabdf7282126
Part 15: Apply two space indent for js/src/builtin/String.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/4f6cdc668207
Part 18: Rewrap lines in js/src/builtin/String.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/19b76ea0f786
Part 19: Remaining prettier errors in js/src/builtin/String.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/b387d0933e42
Part 20: Apply two space indent for js/src/builtin/TypedArray.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/30f04fe93a0b
Part 21: Rewrap lines in js/src/builtin/TypedArray.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/51bb9288e5f0
Part 22: Fix whitespace in js/src/builtin/TypedArray.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/d9b43f4633f8
Part 23: Remaining prettier errors in js/src/builtin/TypedArray.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/c317e8916990
Part 24: Fix prettier errors in eslintrc. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/7d28e64fe6b9
Part 25: Apply two space indent for js/src/builtin/intl/*.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/1c3ad91ce8ec
Part 26: Rewrap lines in js/src/builtin/intl/*.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/f94c2d3cf7ae
Part 27: Remaining prettier errors in js/src/builtin/intl/*.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/94e6e04ec617
Part 28: Reformat generated Intl to match prettier. r=tcampbell
Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/de70aed071a2
Part 29: Rewrap self-hosted code at 80 columns. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/f8fc3c47d6ed
Part 30: Enable prettier for selfhosted code. r=tcampbell,Standard8

https://hg.mozilla.org/mozilla-central/rev/29ba93e15767
https://hg.mozilla.org/mozilla-central/rev/48911a329fcc
https://hg.mozilla.org/mozilla-central/rev/d28d5b505b12
https://hg.mozilla.org/mozilla-central/rev/480f3be49bf1
https://hg.mozilla.org/mozilla-central/rev/dd16540f2123
https://hg.mozilla.org/mozilla-central/rev/71fdd9221205
https://hg.mozilla.org/mozilla-central/rev/1e5c20b1a804
https://hg.mozilla.org/mozilla-central/rev/ff084083223d
https://hg.mozilla.org/mozilla-central/rev/64885a01f4c2
https://hg.mozilla.org/mozilla-central/rev/38a2a58b4811
https://hg.mozilla.org/mozilla-central/rev/953af7b6e4ec
https://hg.mozilla.org/mozilla-central/rev/601f77dbe7c9
https://hg.mozilla.org/mozilla-central/rev/b2c80460a4ff
https://hg.mozilla.org/mozilla-central/rev/5ab0db00d8cf
https://hg.mozilla.org/mozilla-central/rev/9904a8855f7b
https://hg.mozilla.org/mozilla-central/rev/f07b36c9f54d
https://hg.mozilla.org/mozilla-central/rev/cabdf7282126
https://hg.mozilla.org/mozilla-central/rev/4f6cdc668207
https://hg.mozilla.org/mozilla-central/rev/19b76ea0f786
https://hg.mozilla.org/mozilla-central/rev/b387d0933e42
https://hg.mozilla.org/mozilla-central/rev/30f04fe93a0b
https://hg.mozilla.org/mozilla-central/rev/51bb9288e5f0
https://hg.mozilla.org/mozilla-central/rev/d9b43f4633f8
https://hg.mozilla.org/mozilla-central/rev/c317e8916990
https://hg.mozilla.org/mozilla-central/rev/7d28e64fe6b9
https://hg.mozilla.org/mozilla-central/rev/1c3ad91ce8ec
https://hg.mozilla.org/mozilla-central/rev/f94c2d3cf7ae
https://hg.mozilla.org/mozilla-central/rev/94e6e04ec617
https://hg.mozilla.org/mozilla-central/rev/de70aed071a2
https://hg.mozilla.org/mozilla-central/rev/f8fc3c47d6ed

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: