Closed Bug 1927798 Opened 3 months ago Closed 3 months ago

./mach eslint no longer applies the `curly` rule by default

Categories

(Developer Infrastructure :: Lint and Formatting, defect, P2)

Tracking

(firefox-esr128 unaffected, firefox132 wontfix, firefox133 wontfix, firefox134 fixed)

RESOLVED FIXED
134 Branch
Tracking Status
firefox-esr128 --- unaffected
firefox132 --- wontfix
firefox133 --- wontfix
firefox134 --- fixed

People

(Reporter: nordzilla, Assigned: standard8)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Description

I noticed recently that curly braces are not being enforced by ESLint in tree.

I used git bisect and I believe that Bug 1920531 regressed this behavior.

Steps to reproduce

  1. Create a test file example.js in the root of the mozilla-unified tree.
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */

let x = 0;
if (x === 0) true;

  1. Run ./mach eslint --fix example.js

Expected Behavior
✖ 0 problems (0 errors, 0 warnings, 2 fixed)

--- a/before
+++ b/after
@@ -3,5 +3,7 @@
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */

 let x = 0;
-if (x === 0) true;
+if (x === 0) {
+  true;
+}

Actual Behavior
✖ 0 problems (0 errors, 0 warnings, 0 fixed)


  1. Run ./mach eslint --fix example.js --rule "curly:error".
    The file is fixed as expected when manually adding --rule "curly:error".
Summary: ./mach ESLint no longer applies the `curly` rule by default → ./mach eslint no longer applies the `curly` rule by default

Set release status flags based on info from the regressing bug 1920531

:standard8, since you are the author of the regressor, bug 1920531, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(standard8)
Assignee: nobody → standard8
Severity: -- → S4
Priority: -- → P2

This was accidentally disabled in bug 1920531 with the re-organisation of how eslint-plugin-mozilla worked.
The rule needs to be (re)enabled after eslint-config-prettier is applied, as eslint-config-prettier turns it off by default.

Blocks: 1928625
Flags: needinfo?(standard8)
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/99e4075782cd Re-enable the curly rule for ESLint. r=frontend-codestyle-reviewers,mossop
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch

The patch landed in nightly and beta is affected.
:standard8, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox133 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(standard8)
Flags: needinfo?(standard8)
See Also: → 1944705
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: