Closed Bug 1582782 Opened 5 years ago Closed 5 years ago

Enable brace-style eslint rule

Categories

(Thunderbird :: General, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 71.0

People

(Reporter: pmorris, Assigned: pmorris)

References

Details

Attachments

(2 files, 1 obsolete file)

Enable the eslint brace-style rule because Prettier covers most brace formatting issues but not this one:

    }
    // a comment
    else {

Also, enabling this rule will catch brace formatting issues in .html files, which are currently ignored by Prettier (see bug 1560186). I found some of those by enabling this rule.

Part 1 of 2. Manually fixes curly brace formatting in a few .html files.

As part of rolling out Prettier formatting in bug 1572047, we inserted curly brackets using eslint and then relied on Prettier to format them correctly. However, we currently tell Prettier to ignore .html files. So a few of those ended up with curly braces that were not formatted well.

(Per clokep on IRC it is not really feasible to move this JavaScript code into .js files given the way chat message styles work.)

Attachment #9094234 - Flags: review?(clokep)

Part 2 of 2. Enables the brace-style eslint rule for Thunderbird and removes it from the calendar .eslintrc file.

Attachment #9094235 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9094234 [details] [diff] [review] part1-fix-curly-braces-in-html-0.patch Review of attachment 9094234 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Thanks!
Attachment #9094234 - Flags: review?(clokep) → review+
Comment on attachment 9094235 [details] [diff] [review] part2-enable-brace-style-eslint-rule-0.patch That commit message has the wrong bug number which can be fatal if I don't notice it later. Worth correcting since a backout/reland is more expensive.

Fixes bug number in commit message. Thanks for catching that Jorg.

Attachment #9094235 - Attachment is obsolete: true
Attachment #9094235 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9094261 [details] [diff] [review] part2-enable-brace-style-eslint-rule-1.patch Accidentally lost the review request flag when fixing the bug number in the commit message.
Attachment #9094261 - Flags: review?(mkmelin+mozilla)
Attachment #9094261 - Flags: review?(mkmelin+mozilla) → review+
Keywords: checkin-needed

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/eb003d43c655
Fix brace formatting in some .html files. r=clokep
https://hg.mozilla.org/comm-central/rev/7e7de17ddcc0
Enable 'brace-style' eslint rule. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 71.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: