Bug 143212

Summary: Web Inspector: Add more ESLint rules that reflect the current state of the code base
Product: WebKit Reporter: Tobias Reiss <tobi+webkit>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch none

Tobias Reiss
Reported 2015-03-29 23:59:35 PDT
We should get to a point where ESLint can actually be used as a pre-commit hook, similar to "Tools/Scripts/check-webkit-style". But right now we just have too many linting errors, which is because .eslintrc does not reflect the current state of the code. As soon as we have defined most of the rules, we can fix the errors.
Attachments
patch (36.59 KB, patch)
2015-03-30 00:23 PDT, Tobias Reiss
no flags
Radar WebKit Bug Importer
Comment 1 2015-03-29 23:59:46 PDT
Tobias Reiss
Comment 2 2015-03-30 00:23:51 PDT
Timothy Hatcher
Comment 3 2015-03-30 08:44:38 PDT
Comment on attachment 249712 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=249712&action=review > Source/WebInspectorUI/.eslintrc:83 > + "comma-dangle": 0, I don't like using a comma dangle. > Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js:-214 > - var currentDisplay = undefined; This should be legal. > Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js:-360 > - var prototypeName = undefined; Ditto. > Source/WebInspectorUI/UserInterface/Views/TypeTokenView.js:-113 > - }.bind(this)); This looks like a bug. The function uses this. > Source/WebInspectorUI/UserInterface/Views/TypeTokenView.js:113 > + }); Never mind. I see it does not now.
WebKit Commit Bot
Comment 4 2015-03-30 09:30:05 PDT
Comment on attachment 249712 [details] patch Clearing flags on attachment: 249712 Committed r182142: <http://trac.webkit.org/changeset/182142>
WebKit Commit Bot
Comment 5 2015-03-30 09:30:09 PDT
All reviewed patches have been landed. Closing bug.
Tobias Reiss
Comment 6 2015-03-30 12:23:32 PDT
Comment on attachment 249712 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=249712&action=review >> Source/WebInspectorUI/.eslintrc:83 >> + "comma-dangle": 0, > > I don't like using a comma dangle. The rule is turned off. If you don't want contributors to use trailing commas than we could set "comma-dangle" to "never". >> Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js:-214 >> - var currentDisplay = undefined; > > This should be legal. If you want both to be legal, we could set "no-undef-init" to 0. But keep in mind that `currentDisplay` is undefined by default. There's no need to set it explicitly.
Joseph Pecoraro
Comment 7 2015-03-30 14:55:51 PDT
(In reply to comment #3) > Comment on attachment 249712 [details] > patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=249712&action=review > > > Source/WebInspectorUI/.eslintrc:83 > > + "comma-dangle": 0, > > I don't like using a comma dangle. I do! It makes diffs easier to read. Also, any good minifier can get rid of the extra commas.
Tobias Reiss
Comment 8 2015-03-30 15:05:27 PDT
Comment on attachment 249712 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=249712&action=review >>>> Source/WebInspectorUI/.eslintrc:83 >>>> + "comma-dangle": 0, >>> >>> I don't like using a comma dangle. >> >> The rule is turned off. If you don't want contributors to use trailing commas than we could set "comma-dangle" to "never". > > I do! It makes diffs easier to read. Also, any good minifier can get rid of the extra commas. ESLint offers 3 variations. "never", "always" and "always-multiline". https://github.com/eslint/eslint/blob/master/docs/rules/comma-dangle.md.
Note You need to log in before you can comment on or make changes to this bug.