Closed Bug 1782212 Opened 2 years ago Closed 2 years ago

Enable "curly" eslint rule 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

Details

Attachments

(29 files)

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

There isn't (anymore) a clear rule when curly brackets can be omitted in self-hosted code, in some places the styling varies within a single function. Let's add curly brackets everywhere, so we can enable the "curly" eslint rule and because it makes the code more similar to C++ code, where we also require curly brackets everywhere.

Blocks: 1782273

This is a reasonable thing to standardize. Thanks for cleaning these up.

Severity: -- → N/A
Priority: -- → P1
Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/b331bdbd240e
Part 1: Add curly brackets to js/src/builtin/Array.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/caf30242fabf
Part 2: Add curly brackets to js/src/builtin/Date.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/56c670145cae
Part 3: Add curly brackets to js/src/builtin/Error.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/1ac550b468d1
Part 4: Add curly brackets to js/src/builtin/Function.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/df263590d48f
Part 5: Add curly brackets to js/src/builtin/Generator.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/81b94d4664ec
Part 6: Add curly brackets to js/src/builtin/Iterator.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/e5d000c3891f
Part 7: Add curly brackets to js/src/builtin/Map.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/316b2c81dd84
Part 8: Add curly brackets to js/src/builtin/Number.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/9509f35dd91b
Part 9: Add curly brackets to js/src/builtin/Object.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/846dcd17d480
Part 10: Add curly brackets to js/src/builtin/Promise.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/5527faed392b
Part 11: Add curly brackets to js/src/builtin/Reflect.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/8162941ed0a0
Part 12: Add curly brackets to js/src/builtin/RegExp.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/be948f4bddea
Part 13: Add curly brackets to js/src/builtin/RegExp{Global,Local}ReplaceOpt.h.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/cea4e66816a6
Part 14: Add curly brackets to js/src/builtin/Set.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/775a3ac0e7ea
Part 15: Add curly brackets to js/src/builtin/Sorting.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/b1a721e01ab6
Part 16: Add curly brackets to js/src/builtin/String.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/65fe1393de34
Part 17: Add curly brackets to js/src/builtin/Tuple.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/474032d24cfc
Part 18: Add curly brackets to js/src/builtin/TypedArray.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/df7747be627e
Part 19: Add curly brackets to js/src/builtin/Utilities.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/839e3c4c3cd9
Part 20: Add curly brackets to js/src/builtin/Weak{Map,Set}.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/3f2394bd8e0b
Part 21: Add curly brackets to js/src/builtin/intl/Collator.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/e79ecb3db068
Part 22: Add curly brackets to js/src/builtin/intl/CommonFunctions.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/9cfc677b14db
Part 23: Add curly brackets to js/src/builtin/intl/DateTimeFormat.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/c5df27312a01
Part 24: Add curly brackets to js/src/builtin/intl/DisplayNames.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/4f2d023228d2
Part 25: Add curly brackets to js/src/builtin/intl/ListFormat.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/5f9565c4928f
Part 26: Add curly brackets to js/src/builtin/intl/NumberFormat.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/d01ff7640164
Part 27: Add curly brackets to js/src/builtin/intl/PluralRules.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/6a8d0090dfd3
Part 28: Add curly brackets to js/src/builtin/intl/RelativeTimeFormat.js. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/30041cc71238
Part 29: Enable eslint 'curly' rule for selfhosted js. r=tcampbell

https://hg.mozilla.org/mozilla-central/rev/b331bdbd240e
https://hg.mozilla.org/mozilla-central/rev/caf30242fabf
https://hg.mozilla.org/mozilla-central/rev/56c670145cae
https://hg.mozilla.org/mozilla-central/rev/1ac550b468d1
https://hg.mozilla.org/mozilla-central/rev/df263590d48f
https://hg.mozilla.org/mozilla-central/rev/81b94d4664ec
https://hg.mozilla.org/mozilla-central/rev/e5d000c3891f
https://hg.mozilla.org/mozilla-central/rev/316b2c81dd84
https://hg.mozilla.org/mozilla-central/rev/9509f35dd91b
https://hg.mozilla.org/mozilla-central/rev/846dcd17d480
https://hg.mozilla.org/mozilla-central/rev/5527faed392b
https://hg.mozilla.org/mozilla-central/rev/8162941ed0a0
https://hg.mozilla.org/mozilla-central/rev/be948f4bddea
https://hg.mozilla.org/mozilla-central/rev/cea4e66816a6
https://hg.mozilla.org/mozilla-central/rev/775a3ac0e7ea
https://hg.mozilla.org/mozilla-central/rev/b1a721e01ab6
https://hg.mozilla.org/mozilla-central/rev/65fe1393de34
https://hg.mozilla.org/mozilla-central/rev/474032d24cfc
https://hg.mozilla.org/mozilla-central/rev/df7747be627e
https://hg.mozilla.org/mozilla-central/rev/839e3c4c3cd9
https://hg.mozilla.org/mozilla-central/rev/3f2394bd8e0b
https://hg.mozilla.org/mozilla-central/rev/e79ecb3db068
https://hg.mozilla.org/mozilla-central/rev/9cfc677b14db
https://hg.mozilla.org/mozilla-central/rev/c5df27312a01
https://hg.mozilla.org/mozilla-central/rev/4f2d023228d2
https://hg.mozilla.org/mozilla-central/rev/5f9565c4928f
https://hg.mozilla.org/mozilla-central/rev/d01ff7640164
https://hg.mozilla.org/mozilla-central/rev/6a8d0090dfd3
https://hg.mozilla.org/mozilla-central/rev/30041cc71238

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: