Closed Bug 1928625 Opened 1 year ago Closed 1 year ago

Remove ESLint rule mozilla/consistent-if-bracing as curly already enforces it

Categories

(Developer Infrastructure :: Lint and Formatting, task, P3)

Tracking

(firefox134 fixed)

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(2 files)

In bug 1927798 we are fixing a regression where the curly rule was disabled and are re-enabling it. I remembered about the mozilla/consistent-if-bracing rule whilst I was there, and realised we don't need it any more because curly is set to all, so we will always have braces. The rule was originally enabled in bug 1528751 which landed a while before we enabled the curly rule in bug 1558517.

Whilst here, I also noticed a performance improvement in determining the globals - we are parsing the AST unnecessarily in the case where we are not in the global scope. This only speeds up ESLint by a second over a whole run, but I figured as it is an easy change, we might as well take it.

There's no need to get the AST source if we are not in the global scope.

Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/80270933ffc6 Improve performance of loading globals for ESLint. r=frontend-codestyle-reviewers,mossop https://hg.mozilla.org/integration/autoland/rev/fa800470075c Remove ESLint rule mozilla/consistent-if-bracing as curly already enforces more than it. r=frontend-codestyle-reviewers,mossop
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: