RESOLVED FIXED 175065
Web Inspector: fix ESLint errors
https://bugs.webkit.org/show_bug.cgi?id=175065
Summary Web Inspector: fix ESLint errors
Devin Rousso
Reported 2017-08-01 23:12:00 PDT
I noticed some errors while working on <https://webkit.org/b/175058> Web Inspector: simplify WebInspector with WI
Attachments
Patch (59.33 KB, patch)
2017-08-01 23:24 PDT, Devin Rousso
no flags
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (1.32 MB, application/zip)
2017-08-02 00:49 PDT, Build Bot
no flags
Archive of layout-test-results from ews116 for mac-elcapitan (1.85 MB, application/zip)
2017-08-02 08:44 PDT, Build Bot
no flags
Patch (71.70 KB, patch)
2017-10-13 15:32 PDT, Devin Rousso
no flags
Patch (71.70 KB, patch)
2017-10-13 16:11 PDT, Devin Rousso
no flags
Devin Rousso
Comment 1 2017-08-01 23:24:51 PDT
Build Bot
Comment 2 2017-08-02 00:49:43 PDT
Comment on attachment 316935 [details] Patch Attachment 316935 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/4238546 New failing tests: imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-worker.html imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors.html
Build Bot
Comment 3 2017-08-02 00:49:44 PDT
Created attachment 316945 [details] Archive of layout-test-results from ews104 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Devin Rousso
Comment 4 2017-08-02 01:01:42 PDT
Comment on attachment 316935 [details] Patch Unrelated test failures.
Joseph Pecoraro
Comment 5 2017-08-02 01:30:33 PDT
Comment on attachment 316935 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=316935&action=review > Source/WebInspectorUI/UserInterface/Base/URLUtilities.js:64 > - var match = securityOrigin.match(/^([^:]+):\/\/([^\/:]*)(?::([\d]+))?$/i); > + var match = securityOrigin.match(/^([^:]+):\/\/([^/:]*)(?::([\d]+))?$/i); Hmm, I don't really like this change. I think we should always escape a '/' character inside of a regex, even if it is inside of a character set. > Source/WebInspectorUI/UserInterface/Models/DOMNode.js:605 > - return `[id=\"${id}\"]`; > + return `[id="${id}"]`; Nice! > Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js:569 > - var startChar = line === range.start.line ? range.start.ch : (lineContent.length - lineContent.trimLeft().length); > + var startChar = line === range.start.line ? range.start.ch : lineContent.length - lineContent.trimLeft().length; I think this one hurts readability. In fact I think most of the parents being removed hurt readability... > Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.js:72 > - return name.replace(/\"/g, "\"\""); > + return name.replace(/"/g, "\"\""); Might as well cleanup the other side to be `""`
Joseph Pecoraro
Comment 6 2017-08-02 01:31:14 PDT
> I think this one hurts readability. In fact I think most of the parents > being removed hurt readability... parenthesis*
Build Bot
Comment 7 2017-08-02 08:44:02 PDT
Comment on attachment 316935 [details] Patch Attachment 316935 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4240110 New failing tests: fast/dom/StyleSheet/detached-sheet-owner-node-link.html
Build Bot
Comment 8 2017-08-02 08:44:03 PDT
Created attachment 316961 [details] Archive of layout-test-results from ews116 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Devin Rousso
Comment 9 2017-08-02 11:03:28 PDT
Comment on attachment 316935 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=316935&action=review >> Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js:569 >> + var startChar = line === range.start.line ? range.start.ch : lineContent.length - lineContent.trimLeft().length; > > I think this one hurts readability. In fact I think most of the parents being removed hurt readability... What's your criteria for a parenthesis improving readability? I think that some of the cases here are valid to remove, such as Main.js and ProfileNode.js.
Blaze Burg
Comment 10 2017-08-02 11:15:06 PDT
Comment on attachment 316935 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=316935&action=review >>> Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js:569 >>> + var startChar = line === range.start.line ? range.start.ch : lineContent.length - lineContent.trimLeft().length; >> >> I think this one hurts readability. In fact I think most of the parents being removed hurt readability... > > What's your criteria for a parenthesis improving readability? I think that some of the cases here are valid to remove, such as Main.js and ProfileNode.js. Ditto on Joe. If I have to stop and think about precedence where I didn't before, then it hurts readability.
Timothy Hatcher
Comment 11 2017-10-13 09:35:28 PDT
Comment on attachment 316935 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=316935&action=review >> Source/WebInspectorUI/UserInterface/Base/URLUtilities.js:64 >> + var match = securityOrigin.match(/^([^:]+):\/\/([^/:]*)(?::([\d]+))?$/i); > > Hmm, I don't really like this change. I think we should always escape a '/' character inside of a regex, even if it is inside of a character set. I agree.
Devin Rousso
Comment 12 2017-10-13 15:32:16 PDT
Joseph Pecoraro
Comment 13 2017-10-13 16:07:27 PDT
Comment on attachment 323755 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=323755&action=review r=me! > Source/WebInspectorUI/.eslintrc:129 > + // DOM Utilties Typo: Utilities
Devin Rousso
Comment 14 2017-10-13 16:11:33 PDT
WebKit Commit Bot
Comment 15 2017-10-13 16:52:38 PDT
Comment on attachment 323764 [details] Patch Clearing flags on attachment: 323764 Committed r223308: <https://trac.webkit.org/changeset/223308>
WebKit Commit Bot
Comment 16 2017-10-13 16:52:39 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 17 2017-10-13 16:53:02 PDT
Note You need to log in before you can comment on or make changes to this bug.