Bug 161561

Summary: Web Inspector: Update ESLint rules and run it over most of UserInterface
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: DoNotImportToRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix bburg: review+

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>