Bug 161561 - Web Inspector: Update ESLint rules and run it over most of UserInterface
Summary: Web Inspector: Update ESLint rules and run it over most of UserInterface
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: DoNotImportToRadar
Depends on:
Blocks:
 
Reported: 2016-09-02 18:02 PDT by Joseph Pecoraro
Modified: 2016-09-04 22:15 PDT (History)
6 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (56.61 KB, patch)
2016-09-02 19:09 PDT, Joseph Pecoraro
bburg: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-09-02 18:02:13 PDT
Summary:
Update ESLint rules and run it over most of UserInterface

I ran it over everything except the Views folder, which is a beast on its own.
Updated the settings which catch reasonable issues.
There were some actual issues caught by this, but this update is only mostly pedantic changes.
Comment 1 Joseph Pecoraro 2016-09-02 19:09:40 PDT
Created attachment 287847 [details]
[PATCH] Proposed Fix
Comment 2 BJ Burg 2016-09-03 13:59:14 PDT
Comment on attachment 287847 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=287847&action=review

r=me

> Source/WebInspectorUI/UserInterface/Base/Object.js:41
> +            return listener;

Why not return null or throw an exception in the exceptional cases? These are almost always programming errors we want to fail hard on.

> Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js:992
> +        let nextRecord = function(list) { return list.shift() || null; };

This could be an arrow, I suppose.
Comment 3 Joseph Pecoraro 2016-09-04 21:49:56 PDT
Comment on attachment 287847 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=287847&action=review

>> Source/WebInspectorUI/UserInterface/Base/Object.js:41
>> +            return listener;
> 
> Why not return null or throw an exception in the exceptional cases? These are almost always programming errors we want to fail hard on.

Okay
Comment 4 Joseph Pecoraro 2016-09-04 22:15:00 PDT
<https://trac.webkit.org/changeset/205424>