Closed Bug 1348068 Opened 8 years ago Closed 8 years ago

Enable the key-spacing rule for eslint

Categories

(Toolkit :: General, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: jaws, Assigned: jaws)

References

Details

Attachments

(1 file)

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 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 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+
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
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: