Closed Bug 1452575 Opened 6 years ago Closed 6 years ago

Enable ESLint for devtools/client/shared/**/*.jsm

Categories

(DevTools :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox61 fixed)

RESOLVED FIXED
Firefox 61
Tracking Status
firefox61 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(2 files)

These files are currently ignored for ESLint.

Similar to bug 1451659, we should work on enabling at least some coverage, so that we have basic syntax and various rule checks.

Rules that aren't quick-fixes or easy to do can be done in follow-up bugs, thanks to being able to selectively apply rules via glob-based configurations.
Comment on attachment 8966147 [details]
Bug 1452575 - Automatically fix ESLint issues in shared jsm files in devtools.

https://reviewboard.mozilla.org/r/234880/#review240624

Looks great, thanks for working on it! :)

::: devtools/client/shared/DOMHelpers.jsm:90
(Diff revision 1)
>        }
>      }
>  
>      let child = null;
> -    if (previousSibling)  // then we are walking
> +    if (previousSibling) // then we are walking
> +      {

This brace should be on the previous line before the comment.
Attachment #8966147 - Flags: review?(jryans) → review+
Comment on attachment 8966148 [details]
Bug 1452575 - Enable ESLint for devtools/client/shared/**/*.jsm.

https://reviewboard.mozilla.org/r/234882/#review240626

Looks good, thanks! :)

::: .eslintignore:109
(Diff revision 1)
>  devtools/client/memory/test/chrome/*.html
>  devtools/client/performance/components/test/test_jit_optimizations_01.html
>  devtools/client/responsive.html/test/browser/touch.html
> -devtools/client/shared/*.jsm
> -devtools/client/shared/components/reps/reps.js
>  devtools/client/shared/components/reps/test/mochitest/*.html

I would suggest moving these other reps lines down to the imported section you adjusted.
Attachment #8966148 - Flags: review?(jryans) → review+
Comment on attachment 8966147 [details]
Bug 1452575 - Automatically fix ESLint issues in shared jsm files in devtools.

https://reviewboard.mozilla.org/r/234880/#review240624

> This brace should be on the previous line before the comment.

The second patch fixes all of these (as there's an ESLint rule for devtools already).
Comment on attachment 8966148 [details]
Bug 1452575 - Enable ESLint for devtools/client/shared/**/*.jsm.

https://reviewboard.mozilla.org/r/234882/#review240626

> I would suggest moving these other reps lines down to the imported section you adjusted.

Thank you for spotting that, I'd missed noticing those. Looking at mozilla-central, there's now no devtools/client/shared/components/reps/test/ directory, and the html files referenced aren't anywhere to be seen, so I'll just remove those lines completely.
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4ed9006a80a0
Automatically fix ESLint issues in shared jsm files in devtools. r=jryans
https://hg.mozilla.org/integration/autoland/rev/8ef9106d1ae1
Enable ESLint for devtools/client/shared/**/*.jsm. r=jryans
https://hg.mozilla.org/mozilla-central/rev/4ed9006a80a0
https://hg.mozilla.org/mozilla-central/rev/8ef9106d1ae1
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 61
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.