### 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. ```js /* 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; ``` --- 2) Run `./mach eslint --fix example.js` --- **Expected Behavior** ✖ 0 problems (0 errors, 0 warnings, 2 fixed) ```js /* 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; } ``` **Actual Behavior** ✖ 0 problems (0 errors, 0 warnings, 0 fixed) --- 3) Run `./mach eslint --fix example.js --rule "curly:error"`. The file is fixed as expected when manually adding `--rule "curly:error"`.
Bug 1927798 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
### 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. ```js /* 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; ``` --- 2) Run `./mach eslint --fix example.js` --- **Expected Behavior** ✖ 0 problems (0 errors, 0 warnings, 2 fixed) ```diff --- 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) --- 3) Run `./mach eslint --fix example.js --rule "curly:error"`. The file is fixed as expected when manually adding `--rule "curly:error"`.