Turn on some more eslint styling rules

RESOLVED FIXED in Firefox 53

Status

defect
RESOLVED FIXED
3 years ago
5 months ago

People

(Reporter: mossop, Assigned: mossop)

Tracking

3 Branch
mozilla53

Firefox Tracking Flags

(firefox53 fixed)

Details

Attachments

(6 attachments)

A number of rules and easily be turned on with autofix
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Assignee

Updated

3 years ago
Attachment #8809851 - Flags: review?(standard8)
Attachment #8809852 - Flags: review?(bgrinstead)
Attachment #8809853 - Flags: review?(felipc)
Attachment #8809854 - Flags: review?(MattN+bmo)

Comment 11

3 years ago
mozreview-review
Comment on attachment 8809852 [details]
Bug 1316882: Turn on func-call-spacing eslint rule.

https://reviewboard.mozilla.org/r/92352/#review92464
Attachment #8809852 - Flags: review?(bgrinstead) → review+
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Assignee

Updated

3 years ago
Attachment #8809855 - Flags: review?(jaws)
Comment on attachment 8809855 [details]
Bug 1316882: Turn on space-before-function-paren eslint rule (browser).

https://reviewboard.mozilla.org/r/92358/#review92750
Attachment #8809855 - Flags: review?(jaws) → review+
Comment on attachment 8809851 [details]
Bug 1316882: Turn on space-infix-ops eslint rule.

https://reviewboard.mozilla.org/r/92350/#review92758

::: toolkit/.eslintrc.js:178
(Diff revision 2)
>  
>      // No space padding in parentheses
>      // "space-in-parens": ["error", "never"],
>  
>      // Require spaces around operators
> -    // "space-infix-ops": "error",
> +    "space-infix-ops": "error",

I think we should include {"int32Hint": true} here since it's likely there is a usage of a|0 somewhere in our JS code and we don't normally write it as `a | 0`.
Assignee

Updated

3 years ago
Attachment #8809977 - Flags: review?(jaws)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment on attachment 8809977 [details]
Bug 1316882: Turn on space-before-function-paren eslint rule (toolkit).

https://reviewboard.mozilla.org/r/92454/#review92786

::: toolkit/mozapps/extensions/AddonManager.jsm:2622
(Diff revision 2)
> -      nextObject: function getAddonsWithOperationsByTypes_nextObject
> +      nextObject: function getAddonsWithOperationsByTypes_nextObject(aCaller, aProvider) {
> -                           (aCaller, aProvider) {
>          callProviderAsync(aProvider, "getAddonsWithOperationsByTypes", aTypes,
> -                          function getAddonsWithOperationsByTypes_concatAddons
> +                          function getAddonsWithOperationsByTypes_concatAddons(aProviderAddons) {
> -                                   (aProviderAddons) {

It looks like both of these were wrapped to the next line to keep them under 80chars. We should be able to drop the function names since they're not referenced and just make them anonymous.
Attachment #8809977 - Flags: review?(jaws) → review+
Comment on attachment 8809854 [details]
Bug 1316882: Turn on space-unary-ops eslint rule.

https://reviewboard.mozilla.org/r/92356/#review92872

Thanks
Attachment #8809854 - Flags: review?(MattN+bmo) → review+
Comment on attachment 8809851 [details]
Bug 1316882: Turn on space-infix-ops eslint rule.

Jared, can you take care of this for me please?
Attachment #8809851 - Flags: review?(standard8) → review?(jaws)
Comment on attachment 8809851 [details]
Bug 1316882: Turn on space-infix-ops eslint rule.

https://reviewboard.mozilla.org/r/92350/#review93230

::: toolkit/.eslintrc.js:178
(Diff revision 3)
>  
>      // No space padding in parentheses
>      // "space-in-parens": ["error", "never"],
>  
>      // Require spaces around operators
> -    // "space-infix-ops": "error",
> +    "space-infix-ops": ["error", { "int32Hint": false }],

This still needs to change to { "in32Hint": true }
Attachment #8809851 - Flags: review?(jaws) → review+

Comment 26

3 years ago
mozreview-review
Comment on attachment 8809853 [details]
Bug 1316882: Turn on rest-spread-spacing eslint rule.

https://reviewboard.mozilla.org/r/92354/#review93264
Attachment #8809853 - Flags: review?(felipc) → review+

Comment 27

3 years ago
Pushed by dtownsend@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a958562f3d67
Turn on space-infix-ops eslint rule. r=jaws
https://hg.mozilla.org/integration/mozilla-inbound/rev/5e3138495bcf
Turn on func-call-spacing eslint rule. r=bgrins
https://hg.mozilla.org/integration/mozilla-inbound/rev/519f9207ae90
Turn on rest-spread-spacing eslint rule. r=felipe
https://hg.mozilla.org/integration/mozilla-inbound/rev/e1fa4eab9a05
Turn on space-unary-ops eslint rule. r=MattN
https://hg.mozilla.org/integration/mozilla-inbound/rev/dfa1b55da2b1
Turn on space-before-function-paren eslint rule (browser). r=jaws
https://hg.mozilla.org/integration/mozilla-inbound/rev/4873321befff
Turn on space-before-function-paren eslint rule (toolkit). r=jaws

Updated

a year ago
Product: Testing → Firefox Build System
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.