Closed Bug 1165281 Opened 9 years ago Closed 9 years ago

Enable eslint rules for Loop: whitespace related

Categories

(Hello (Loop) :: Client, defect)

defect
Not set
normal

Tracking

(firefox41 fixed)

RESOLVED FIXED
mozilla41
Iteration:
41.2 - Jun 8
Tracking Status
firefox41 --- fixed

People

(Reporter: standard8, Assigned: aaronraimist, Mentored)

References

Details

(Whiteboard: [lang=js])

Attachments

(3 files, 1 obsolete file)

Enable some more eslint rules for Loop. Rules to enable in this bug:

* key-spacing - no space before :, one space after for object properties 
* no-spaced-func - no spaces between the function identifier and application
* no-wrap-func - no wrapping of non-IIFE statements in parens (currently nothing hits this)

To enable the rule, remove the line from browser/components/loop/.eslintrc and save it.

Then you can run eslint in the browser/components/loop directory with:

  eslint  --ext .js --ext .jsm --ext .jsx .

The errors listed in the output are to be fixed.

If there's errors in a .js file that has an associated .jsx file, then fix the jsx file and run the react tools to generate the .js file (https://wiki.mozilla.org/Loop/Development#Developing).

If you need more help setting up eslint, see https://wiki.mozilla.org/Loop/Development#Additional_Requirements

Information about the eslint rules can be found here:

http://eslint.org/docs/rules/
Assignee: nobody → aaronraimist
Attachment #8613268 - Flags: review?(standard8)
Attached patch bug1165281_no-spaced-func (obsolete) — Splinter Review
This patch works for every error except one in modules/MozLoopPushHandler.jsm. I can't figure out how to fix it.
Attachment #8613269 - Flags: review?(standard8)
Attachment #8613270 - Flags: review?(standard8)
Comment on attachment 8613268 [details] [diff] [review]
bug1165281_key-spacing

Review of attachment 8613268 [details] [diff] [review]:
-----------------------------------------------------------------

Looks great, thanks for the patch!
Attachment #8613268 - Flags: review?(standard8) → review+
Comment on attachment 8613269 [details] [diff] [review]
bug1165281_no-spaced-func

Review of attachment 8613269 [details] [diff] [review]:
-----------------------------------------------------------------

Regarding the MozLoopPushHandler.jsm issue. It isn't quite obvious, the start of the current code is:

      throw new Error("PushSocket: missing required parameter(s):"
                      (pushUri ? "" : " pushUri") +

There's a missing '+' on the end of the line. Adding that seems to be enough to fix the issue. Javascript seems reasonably happy with the current form (or we just haven't hit it yet), but I think its safest to fix it anyway.

Could you update the patch to add the fix please? Then we can get these landed together.
Attachment #8613269 - Flags: review?(standard8)
Attachment #8613270 - Flags: review?(standard8) → review+
Attachment #8613269 - Attachment is obsolete: true
Attachment #8613594 - Flags: review?(standard8)
Comment on attachment 8613594 [details] [diff] [review]
bug1165281_no-spaced-func

Review of attachment 8613594 [details] [diff] [review]:
-----------------------------------------------------------------

Looks great, thanks!
Attachment #8613594 - Flags: review?(standard8) → review+
Keywords: checkin-needed
Iteration: --- → 41.2 - Jun 8
Flags: firefox-backlog+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: