Enable the key-spacing rule for eslint

RESOLVED FIXED in Firefox 55

Status

()

Toolkit
General
RESOLVED FIXED
a year ago
11 months ago

People

(Reporter: jaws, Assigned: jaws)

Tracking

unspecified
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

This rule enforces spacing around the colon in object literal properties. It can verify each property individually, or it can ensure horizontal alignment of adjacent properties in an object literal.
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 3

a year ago
mozreview-review
Comment on attachment 8848203 [details]
Bug 1348068 - Enable the key-spacing rule for eslint and fix the related issues.

https://reviewboard.mozilla.org/r/121138/#review123404

ESLint is now enabled for browser/components/sessionstore/, so that directory needs fixing as well. Also js/src/builtin/TypedObject.js has reported issues when I run the patch locally.

::: browser/components/nsBrowserContentHandler.js:300
(Diff revision 2)
>      return this.mChromeURL;
>    },
>  
>    /* nsISupports */
> -  QueryInterface : XPCOMUtils.generateQI([nsICommandLineHandler,
> +  QueryInterface: XPCOMUtils.generateQI([nsICommandLineHandler,
>                                            nsIBrowserHandler,

Please also fix the indentation of the follow-on lines here.

::: toolkit/components/asyncshutdown/nsAsyncShutdown.js:189
(Diff revision 2)
>      this._deletePromisified(xpcomBlocker);
>      return this._moduleClient.removeBlocker(moduleBlocker);
>    },
>  
>    /* ........ QueryInterface .............. */
> -  QueryInterface :  XPCOMUtils.generateQI([Ci.nsIAsyncShutdownBarrier]),
> +  QueryInterface:  XPCOMUtils.generateQI([Ci.nsIAsyncShutdownBarrier]),

nit: The change here makes the alignment of the next line look a bit strange.

::: toolkit/components/asyncshutdown/nsAsyncShutdown.js:221
(Diff revision 2)
>      });
>      // By specification, _moduleBarrier.wait() cannot reject.
>    },
>  
>    /* ........ QueryInterface .............. */
> -  QueryInterface :  XPCOMUtils.generateQI([Ci.nsIAsyncShutdownBarrier]),
> +  QueryInterface:  XPCOMUtils.generateQI([Ci.nsIAsyncShutdownBarrier]),

ditto

::: toolkit/components/asyncshutdown/nsAsyncShutdown.js:268
(Diff revision 2)
>    makeBarrier(name) {
>      return new nsAsyncShutdownBarrier(new AsyncShutdown.Barrier(name));
>    },
>  
>    /* ........ QueryInterface .............. */
> -  QueryInterface :  XPCOMUtils.generateQI([Ci.nsIAsyncShutdownService]),
> +  QueryInterface:  XPCOMUtils.generateQI([Ci.nsIAsyncShutdownService]),

ditto

::: toolkit/components/contentprefs/tests/unit/test_stringGroups.js:15
(Diff revision 2)
>    var statement = cps.DBConnection.createStatement("PRAGMA synchronous");
>    statement.executeStep();
>    do_check_eq(0, statement.getInt32(0));
>  
>    // These are the different types of aGroup arguments we'll test.
> -  var anObject = {"foo":"bar"};                                // a simple object
> +  var anObject = {"foo": "bar"};                                // a simple object

nit: adjust comment spacing as well.
Attachment #8848203 - Flags: review?(standard8) → review-
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 6

11 months ago
mozreview-review
Comment on attachment 8848203 [details]
Bug 1348068 - Enable the key-spacing rule for eslint and fix the related issues.

https://reviewboard.mozilla.org/r/121138/#review124908

::: toolkit/.eslintrc.js:53
(Diff revision 4)
>  
>      // Two space indent
>      // "indent": ["error", 2, { "SwitchCase": 1 }],
>  
>      // Space after colon not before in property declarations
> -    // "key-spacing": ["error", { "beforeColon": false, "afterColon": true, "mode": "minimum" }],
> +    "key-spacing": ["error", { "beforeColon": false, "afterColon": true, "mode": "minimum" }],

This will fail now - you'll need to make the change in the plugin, please also bump the plugin version number.
Attachment #8848203 - Flags: review?(standard8) → review+
Comment hidden (mozreview-request)

Comment 8

11 months ago
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/85907db679f0
Enable the key-spacing rule for eslint and fix the related issues. r=standard8

Comment 9

11 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/85907db679f0
Status: ASSIGNED → RESOLVED
Last Resolved: 11 months ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.