Web Inspector: Enable and enforce some recommended and stylistic ESLint rules
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Sep 2016 05:02:38 +0000 (05:02 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Sep 2016 05:02:38 +0000 (05:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=161567

Reviewed by Brian Burg.

* .eslintrc:
* UserInterface/Base/EventListener.js:
* UserInterface/Base/EventListenerSet.js:
* UserInterface/Base/MIMETypeUtilities.js:
* UserInterface/Base/Main.js:
* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
* UserInterface/Controllers/DOMTreeManager.js:
* UserInterface/Controllers/TimelineManager.js:
* UserInterface/Models/CSSKeywordCompletions.js:
* UserInterface/Models/DOMNode.js:
* UserInterface/Models/DOMNodeStyles.js:
* UserInterface/Models/Frame.js:
* UserInterface/Models/Geometry.js:
* UserInterface/Models/ProfileNode.js:
* UserInterface/Models/RenderingFrameTimelineRecord.js:
* UserInterface/Models/SourceCodeLocation.js:
* UserInterface/Protocol/RemoteObject.js:
* UserInterface/Views/ApplicationCacheFrameContentView.js:
* UserInterface/Views/ContextMenu.js:
* UserInterface/Views/DOMTreeContentView.js:
* UserInterface/Views/DOMTreeElement.js:
* UserInterface/Views/DataGrid.js:
* UserInterface/Views/GeneralTreeElement.js:
* UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
* UserInterface/Views/LogContentView.js:
* UserInterface/Views/OpenResourceDialog.js:
* UserInterface/Views/StyleDetailsPanel.js:
* UserInterface/Views/VisualStyleDetailsPanel.js:
* UserInterface/Views/VisualStyleKeywordPicker.js:
* UserInterface/Views/VisualStylePropertyEditor.js:
* UserInterface/Workers/Formatter/FormatterWorker.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205426 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
Source/WebInspectorUI/.eslintrc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/EventListener.js
Source/WebInspectorUI/UserInterface/Base/EventListenerSet.js
Source/WebInspectorUI/UserInterface/Base/MIMETypeUtilities.js
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js
Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js
Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js
Source/WebInspectorUI/UserInterface/Models/DOMNode.js
Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js
Source/WebInspectorUI/UserInterface/Models/Frame.js
Source/WebInspectorUI/UserInterface/Models/Geometry.js
Source/WebInspectorUI/UserInterface/Models/ProfileNode.js
Source/WebInspectorUI/UserInterface/Models/RenderingFrameTimelineRecord.js
Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js
Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js
Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.js
Source/WebInspectorUI/UserInterface/Views/ContextMenu.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
Source/WebInspectorUI/UserInterface/Views/DataGrid.js
Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js
Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineDataGridNode.js
Source/WebInspectorUI/UserInterface/Views/LogContentView.js
Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js
Source/WebInspectorUI/UserInterface/Views/StyleDetailsPanel.js
Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js
Source/WebInspectorUI/UserInterface/Views/VisualStyleKeywordPicker.js
Source/WebInspectorUI/UserInterface/Views/VisualStylePropertyEditor.js
Source/WebInspectorUI/UserInterface/Workers/Formatter/FormatterWorker.js

index 97735c8..96fc399 100644 (file)
@@ -24,6 +24,7 @@
  */
 
 {
+    "extends": "eslint:recommended",
     "env": {
         "browser": true,
         "es6": true,
         "parseLocationQueryParameters": true,
     },
     "rules": {
-        "comma-dangle": 0,
+        "array-bracket-spacing": [2, "never"],
+        "block-spacing": [2, "always"],
+        "comma-dangle": [2, "only-multiline"],
+        "comma-spacing": [2, {"before": false, "after": true}],
+        "comma-style": [2, "last"],
         "consistent-return": 2,
         "curly": 0,
         "dot-notation": 0,
+        "eol-last": 2,
         "eqeqeq": 2,
-        "keyword-spacing": 2,
+        "func-call-spacing": [2, "never"],
+        "key-spacing": [2, {"beforeColon": false, "afterColon": true}],
+        "keyword-spacing": [2, {"before": true, "after": true}],
         "new-cap": 0,
         "new-parens": 0,
         "no-console": 0,
         "no-extra-bind": 2,
         "no-extra-parens": [2, "all", {"nestedBinaryExpressions": false}],
         "no-extra-semi": 2,
+        "no-global-assign": 2,
         "no-inner-declarations": 0,
+        "no-multi-spaces": 2,
         "no-new": 0,
         "no-proto": 0,
         "no-redeclare": 0,
         "no-return-assign": 2,
+        "no-self-compare": 2,
         "no-shadow": 0,
         "no-trailing-spaces": 2,
         "no-undef": 2,
         "no-unused-expressions": 2,
         "no-unused-vars": [2, {"vars": "all", "args": "none"}],
         "no-use-before-define": 0,
+        "object-curly-spacing": [2, "never"],
         "quotes": [2, "double"],
         "semi": 2,
+        "semi-spacing": [2, {"before": false, "after": true}],
         "space-infix-ops": 2,
+        "spaced-comment": [2, "always"],
         "strict": 0,
         "valid-typeof": 2,
     }
index 1c6545b..7a06f07 100644 (file)
@@ -1,5 +1,44 @@
 2016-09-04  Joseph Pecoraro  <pecoraro@apple.com>
 
+        Web Inspector: Enable and enforce some recommended and stylistic ESLint rules
+        https://bugs.webkit.org/show_bug.cgi?id=161567
+
+        Reviewed by Brian Burg.
+
+        * .eslintrc:
+        * UserInterface/Base/EventListener.js:
+        * UserInterface/Base/EventListenerSet.js:
+        * UserInterface/Base/MIMETypeUtilities.js:
+        * UserInterface/Base/Main.js:
+        * UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
+        * UserInterface/Controllers/DOMTreeManager.js:
+        * UserInterface/Controllers/TimelineManager.js:
+        * UserInterface/Models/CSSKeywordCompletions.js:
+        * UserInterface/Models/DOMNode.js:
+        * UserInterface/Models/DOMNodeStyles.js:
+        * UserInterface/Models/Frame.js:
+        * UserInterface/Models/Geometry.js:
+        * UserInterface/Models/ProfileNode.js:
+        * UserInterface/Models/RenderingFrameTimelineRecord.js:
+        * UserInterface/Models/SourceCodeLocation.js:
+        * UserInterface/Protocol/RemoteObject.js:
+        * UserInterface/Views/ApplicationCacheFrameContentView.js:
+        * UserInterface/Views/ContextMenu.js:
+        * UserInterface/Views/DOMTreeContentView.js:
+        * UserInterface/Views/DOMTreeElement.js:
+        * UserInterface/Views/DataGrid.js:
+        * UserInterface/Views/GeneralTreeElement.js:
+        * UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
+        * UserInterface/Views/LogContentView.js:
+        * UserInterface/Views/OpenResourceDialog.js:
+        * UserInterface/Views/StyleDetailsPanel.js:
+        * UserInterface/Views/VisualStyleDetailsPanel.js:
+        * UserInterface/Views/VisualStyleKeywordPicker.js:
+        * UserInterface/Views/VisualStylePropertyEditor.js:
+        * UserInterface/Workers/Formatter/FormatterWorker.js:
+
+2016-09-04  Joseph Pecoraro  <pecoraro@apple.com>
+
         Web Inspector: Run ESLint over UserInterface/Views
         https://bugs.webkit.org/show_bug.cgi?id=161564
 
index 0bcb099..b009f88 100644 (file)
@@ -42,7 +42,7 @@ WebInspector.EventListener = class EventListener
         console.assert(callback, "Missing callback for event: " + type);
         console.assert(emitter, "Missing event emitter for event: " + type);
         var emitterIsValid = emitter && (emitter instanceof WebInspector.Object || emitter instanceof Node || (typeof emitter.addEventListener === "function"));
-        console.assert(emitterIsValid,  "Event emitter ", emitter, " (type:" + type + ") is null or does not implement Node or WebInspector.Object!");
+        console.assert(emitterIsValid, "Event emitter ", emitter, " (type:" + type + ") is null or does not implement Node or WebInspector.Object!");
 
         if (!emitterIsValid || !type || !callback)
             return;
index aa4f50b..bc392c4 100644 (file)
@@ -47,7 +47,7 @@ WebInspector.EventListenerSet = class EventListenerSet
         console.assert(callback, "Missing callback for event: " + type);
         console.assert(type, "Tried to register listener for unknown event: " + type);
         var emitterIsValid = emitter && (emitter instanceof WebInspector.Object || emitter instanceof Node || (typeof emitter.addEventListener === "function"));
-        console.assert(emitterIsValid,  "Event emitter ", emitter, " (type:" + type + ") is null or does not implement Node or WebInspector.Object!");
+        console.assert(emitterIsValid, "Event emitter ", emitter, " (type:" + type + ") is null or does not implement Node or WebInspector.Object!");
 
         if (!emitterIsValid || !type || !callback)
             return;
index 819d119..42bced5 100644 (file)
@@ -104,11 +104,9 @@ WebInspector.fileExtensionForMIMEType = function(mimeType)
         // Image types.
         "image/bmp": "bmp",
         "image/gif": "gif",
-        "image/jpeg": "jpeg",
         "image/jpeg": "jpg",
         "application/pdf": "pdf",
         "image/png": "png",
-        "image/tiff": "tif",
         "image/tiff": "tiff",
 
         // Font types and Media types are ignored for now.
index a5b4afb..7fd095a 100644 (file)
@@ -2155,7 +2155,7 @@ WebInspector.linkifyLocation = function(url, lineNumber, columnNumber, className
 
     if (!sourceCode) {
         var anchor = document.createElement("a");
-        anchor.href  = url;
+        anchor.href = url;
         anchor.lineNumber = lineNumber;
         if (className)
             anchor.className = className;
@@ -2351,33 +2351,33 @@ WebInspector.highlightRangesWithStyleClass = function(element, resultRanges, sty
         var lastTextNode = textNodeSnapshot.snapshotItem(endIndex);
         var lastText = lastTextNode.textContent;
         lastTextNode.textContent = lastText.substring(endOffset - nodeRanges[endIndex].offset);
-        changes.push({ node: lastTextNode, type: "changed", oldText: lastText, newText: lastTextNode.textContent });
+        changes.push({node: lastTextNode, type: "changed", oldText: lastText, newText: lastTextNode.textContent});
 
         if (startIndex === endIndex) {
             lastTextNode.parentElement.insertBefore(highlightNode, lastTextNode);
-            changes.push({ node: highlightNode, type: "added", nextSibling: lastTextNode, parent: lastTextNode.parentElement });
+            changes.push({node: highlightNode, type: "added", nextSibling: lastTextNode, parent: lastTextNode.parentElement});
             highlightNodes.push(highlightNode);
 
             var prefixNode = ownerDocument.createTextNode(lastText.substring(0, startOffset - nodeRanges[startIndex].offset));
             lastTextNode.parentElement.insertBefore(prefixNode, highlightNode);
-            changes.push({ node: prefixNode, type: "added", nextSibling: highlightNode, parent: lastTextNode.parentElement });
+            changes.push({node: prefixNode, type: "added", nextSibling: highlightNode, parent: lastTextNode.parentElement});
         } else {
             var firstTextNode = textNodeSnapshot.snapshotItem(startIndex);
             var firstText = firstTextNode.textContent;
             var anchorElement = firstTextNode.nextSibling;
 
             firstTextNode.parentElement.insertBefore(highlightNode, anchorElement);
-            changes.push({ node: highlightNode, type: "added", nextSibling: anchorElement, parent: firstTextNode.parentElement });
+            changes.push({node: highlightNode, type: "added", nextSibling: anchorElement, parent: firstTextNode.parentElement});
             highlightNodes.push(highlightNode);
 
             firstTextNode.textContent = firstText.substring(0, startOffset - nodeRanges[startIndex].offset);
-            changes.push({ node: firstTextNode, type: "changed", oldText: firstText, newText: firstTextNode.textContent });
+            changes.push({node: firstTextNode, type: "changed", oldText: firstText, newText: firstTextNode.textContent});
 
             for (var j = startIndex + 1; j < endIndex; j++) {
                 var textNode = textNodeSnapshot.snapshotItem(j);
                 var text = textNode.textContent;
                 textNode.textContent = "";
-                changes.push({ node: textNode, type: "changed", oldText: text, newText: textNode.textContent });
+                changes.push({node: textNode, type: "changed", oldText: text, newText: textNode.textContent});
             }
         }
         startIndex = endIndex;
index b263ca8..03def84 100644 (file)
@@ -509,7 +509,7 @@ WebInspector.CodeMirrorTokenTrackingController = class CodeMirrorTokenTrackingCo
             // Peek ahead to see if the next token is "}" or ",". If it is, we are a shorthand and therefore a variable.
             let shorthand = false;
             let mode = tokenInfo.innerMode.mode;
-            let position =  {line: tokenInfo.position.line, ch: tokenInfo.token.end};
+            let position = {line: tokenInfo.position.line, ch: tokenInfo.token.end};
             WebInspector.walkTokens(this._codeMirror, mode, position, function(tokenType, string) {
                 if (tokenType)
                     return false;
index 1cda8e5..f6a6bcd 100644 (file)
@@ -167,7 +167,7 @@ WebInspector.DOMTreeManager = class DOMTreeManager extends WebInspector.Object
             var node = this._idToDOMNode[nodeId];
             if (node) {
                 node._setAttributesPayload(attributes);
-                this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.AttributeModified, { node, name: "style" });
+                this.dispatchEventToListeners(WebInspector.DOMTreeManager.Event.AttributeModified, {node, name: "style"});
                 node.dispatchEventToListeners(WebInspector.DOMNode.Event.AttributeModified, {name: "style"});
             }
         }
index a7d1d8b..dac3faa 100644 (file)
@@ -594,7 +594,7 @@ WebInspector.TimelineManager = class TimelineManager extends WebInspector.Object
             console.assert(isNaN(endTime));
 
             // Pass the startTime as the endTime since this record type has no duration.
-            let timerDetails = {timerId: recordPayload.data.timerId, timeout: recordPayload.data.timeout, repeating: !recordPayload.data.singleShot};
+            var timerDetails = {timerId: recordPayload.data.timerId, timeout: recordPayload.data.timeout, repeating: !recordPayload.data.singleShot};
             return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.TimerInstalled, startTime, startTime, callFrames, sourceCodeLocation, timerDetails);
 
         case TimelineAgent.EventType.TimerRemove:
index 9527c7b..f5aa70c 100644 (file)
@@ -296,7 +296,7 @@ WebInspector.CSSKeywordCompletions._propertyKeywordMap = {
         "hidden", "auto", "visible", "overlay", "scroll", "marquee", "-webkit-paged-x", "-webkit-paged-y"
     ],
     "margin-bottom-collapse": [
-        "collapse",  "separate", "discard"
+        "collapse", "separate", "discard"
     ],
     "-webkit-box-reflect": [
         "none", "left", "right", "above", "below"
index c6fc009..df7c64c 100644 (file)
@@ -397,7 +397,7 @@ WebInspector.DOMNode = class DOMNode extends WebInspector.Object
         {
             if (!error) {
                 delete this._attributesMap[name];
-                for (var i = 0;  i < this._attributes.length; ++i) {
+                for (var i = 0; i < this._attributes.length; ++i) {
                     if (this._attributes[i].name === name) {
                         this._attributes.splice(i, 1);
                         break;
index f9dcd6f..d42725c 100644 (file)
@@ -269,7 +269,7 @@ WebInspector.DOMNodeStyles = class DOMNodeStyles extends WebInspector.Object
 
         // COMPATIBILITY (iOS 9): Before CSS.createStyleSheet, CSS.addRule could be called with a contextNode.
         if (!CSSAgent.createStyleSheet) {
-            CSSAgent.addRule.invoke({contextNodeId: this._node.id , selector}, addedRule.bind(this));
+            CSSAgent.addRule.invoke({contextNodeId: this._node.id, selector}, addedRule.bind(this));
             return;
         }
 
index bf116a2..605e8b2 100644 (file)
@@ -208,7 +208,7 @@ WebInspector.Frame = class Frame extends WebInspector.Object
         if (this._executionContextList.contexts.length) {
             let contexts = this._executionContextList.contexts.slice();
             this._executionContextList.clear();
-            this.dispatchEventToListeners(WebInspector.Frame.Event.ExecutionContextsCleared, {committingProvisionalLoad:!!committingProvisionalLoad, contexts});
+            this.dispatchEventToListeners(WebInspector.Frame.Event.ExecutionContextsCleared, {committingProvisionalLoad: !!committingProvisionalLoad, contexts});
         }
     }
 
index 2ca2a42..7c775ab 100644 (file)
@@ -263,10 +263,10 @@ WebInspector.EdgeInsets = class EdgeInsets
 };
 
 WebInspector.RectEdge = {
-    MIN_X : 0,
-    MIN_Y : 1,
-    MAX_X : 2,
-    MAX_Y : 3
+    MIN_X: 0,
+    MIN_Y: 1,
+    MAX_X: 2,
+    MAX_Y: 3
 };
 
 WebInspector.Quad = class Quad
index a825fd9..e6e9522 100644 (file)
@@ -91,7 +91,7 @@ WebInspector.ProfileNode = class ProfileNode extends WebInspector.Object
     get startTime()
     {
         if (this._startTime === undefined)
-            this._startTime =  Math.max(0, this._calls[0].startTime);
+            this._startTime = Math.max(0, this._calls[0].startTime);
         return this._startTime;
     }
 
index 36b7482..d6b502f 100644 (file)
@@ -60,7 +60,7 @@ WebInspector.RenderingFrameTimelineRecord = class RenderingFrameTimelineRecord e
         case WebInspector.TimelineRecord.Type.Script:
             return WebInspector.RenderingFrameTimelineRecord.TaskType.Script;
         case WebInspector.TimelineRecord.Type.Layout:
-            if (record.eventType  === WebInspector.LayoutTimelineRecord.EventType.Paint || record.eventType === WebInspector.LayoutTimelineRecord.EventType.Composite)
+            if (record.eventType === WebInspector.LayoutTimelineRecord.EventType.Paint || record.eventType === WebInspector.LayoutTimelineRecord.EventType.Composite)
                 return WebInspector.RenderingFrameTimelineRecord.TaskType.Paint;
             return WebInspector.RenderingFrameTimelineRecord.TaskType.Layout;
         default:
index 40485d7..7969170 100644 (file)
@@ -332,11 +332,11 @@ WebInspector.SourceCodeLocation = class SourceCodeLocation extends WebInspector.
 
         case WebInspector.SourceCodeLocation.NameStyle.Short:
         case WebInspector.SourceCodeLocation.NameStyle.Full:
-            let displayURL = sourceCode.displayURL;
-            let name = nameStyle === WebInspector.SourceCodeLocation.NameStyle.Full && displayURL ? displayURL : sourceCode.displayName;
+            var displayURL = sourceCode.displayURL;
+            var name = nameStyle === WebInspector.SourceCodeLocation.NameStyle.Full && displayURL ? displayURL : sourceCode.displayName;
             if (columnStyle === WebInspector.SourceCodeLocation.ColumnStyle.Hidden)
                 return prefix + name;
-            let lineSuffix = displayURL ? ":" + lineString : WebInspector.UIString(" (line %s)").format(lineString);
+            var lineSuffix = displayURL ? ":" + lineString : WebInspector.UIString(" (line %s)").format(lineString);
             return prefix + name + lineSuffix;
 
         default:
index db1b67c..d78ef7d 100644 (file)
@@ -312,7 +312,7 @@ WebInspector.RemoteObject = class RemoteObject
         }
 
         // FIXME: It doesn't look like setPropertyValue is used yet. This will need to be tested when it is again (editable ObjectTrees).
-        RuntimeAgent.evaluate.invoke({expression:appendWebInspectorSourceURL(value), doNotPauseOnExceptionsAndMuteConsole:true}, evaluatedCallback.bind(this));
+        RuntimeAgent.evaluate.invoke({expression: appendWebInspectorSourceURL(value), doNotPauseOnExceptionsAndMuteConsole: true}, evaluatedCallback.bind(this));
 
         function evaluatedCallback(error, result, wasThrown)
         {
@@ -328,7 +328,7 @@ WebInspector.RemoteObject = class RemoteObject
 
             delete result.description; // Optimize on traffic.
 
-            RuntimeAgent.callFunctionOn(this._objectId, appendWebInspectorSourceURL(setPropertyValue.toString()), [{value:name}, result], true, undefined, propertySetCallback.bind(this));
+            RuntimeAgent.callFunctionOn(this._objectId, appendWebInspectorSourceURL(setPropertyValue.toString()), [{value: name}, result], true, undefined, propertySetCallback.bind(this));
 
             if (result._objectId)
                 RuntimeAgent.releaseObject(result._objectId);
index d3678e0..7760d95 100644 (file)
@@ -186,7 +186,7 @@ WebInspector.ApplicationCacheFrameContentView = class ApplicationCacheFrameConte
             case "type": comparator = localeCompare.bind(this, "type"); break;
             case "size": comparator = numberCompare.bind(this, "size"); break;
             case "url":
-            default:  comparator = localeCompare.bind(this, "url"); break;
+            default: comparator = localeCompare.bind(this, "url"); break;
         }
 
         this._dataGrid.sortNodes(comparator);
index 6a7dff0..e62e8f9 100644 (file)
@@ -234,4 +234,4 @@ WebInspector.ContextMenu = class ContextMenu extends WebInspector.ContextSubMenu
     }
 };
 
-WebInspector.ContextMenu.ProposedMenuSymbol = Symbol("context-menu-proposed-menu");
\ No newline at end of file
+WebInspector.ContextMenu.ProposedMenuSymbol = Symbol("context-menu-proposed-menu");
index 3ff3eba..138bfb4 100644 (file)
@@ -165,7 +165,7 @@ WebInspector.DOMTreeContentView = class DOMTreeContentView extends WebInspector.
             WebInspector.archiveMainFrame();
         }
 
-        return { customSaveHandler: saveHandler };
+        return {customSaveHandler: saveHandler};
     }
 
     get supportsSearch()
index 11fc097..7d138c5 100644 (file)
@@ -1200,7 +1200,7 @@ WebInspector.DOMTreeElement = class DOMTreeElement extends WebInspector.TreeElem
     _buildTagDOM(parentElement, tagName, isClosingTag, isDistinctTreeElement)
     {
         var node = this.representedObject;
-        var classes = [ "html-tag" ];
+        var classes = ["html-tag"];
         if (isClosingTag && isDistinctTreeElement)
             classes.push("close");
         var tagElement = parentElement.createChild("span", classes.join(" "));
@@ -1526,13 +1526,13 @@ WebInspector.DOMTreeElement = class DOMTreeElement extends WebInspector.TreeElem
         var match = searchRegex.exec(text);
         var matchRanges = [];
         while (match) {
-            matchRanges.push({ offset: match.index, length: match[0].length });
+            matchRanges.push({offset: match.index, length: match[0].length});
             match = searchRegex.exec(text);
         }
 
         // Fall back for XPath, etc. matches.
         if (!matchRanges.length)
-            matchRanges.push({ offset: 0, length: text.length });
+            matchRanges.push({offset: 0, length: text.length});
 
         this._highlightResult = [];
         WebInspector.highlightRangesWithStyleClass(this.title, matchRanges, WebInspector.DOMTreeElement.SearchHighlightStyleClassName, this._highlightResult);
index 0ef2789..37ac8e6 100644 (file)
@@ -1801,7 +1801,7 @@ WebInspector.DataGrid = class DataGrid extends WebInspector.View
         this._dataTableColumnGroupElement.children[leftCellIndex].style.width = percentLeftColumn;
 
         var percentRightColumn = (((rightEdgeOfNextColumn - dragPoint) / this._dataTableElement.offsetWidth) * 100) + "%";
-        this._headerTableColumnGroupElement.children[rightCellIndex].style.width =  percentRightColumn;
+        this._headerTableColumnGroupElement.children[rightCellIndex].style.width = percentRightColumn;
         this._dataTableColumnGroupElement.children[rightCellIndex].style.width = percentRightColumn;
 
         this._positionResizerElements();
index 988caf6..e4a8895 100644 (file)
@@ -330,7 +330,7 @@ WebInspector.GeneralTreeElement = class GeneralTreeElement extends WebInspector.
         // and the tool tip only cares about the text.
         let mainTitleText = this._mainTitleElement.textContent;
         let subtitleText = this._subtitleElement ? this._subtitleElement.textContent : "";
-        let large = this.treeOutline  && this.treeOutline.large;
+        let large = this.treeOutline && this.treeOutline.large;
         if (mainTitleText && subtitleText)
             this._listItemNode.title = mainTitleText + (large ? "\n" : " \u2014 ") + subtitleText;
         else if (mainTitleText)
index a6be3c1..f6d2e2f 100644 (file)
@@ -54,11 +54,11 @@ WebInspector.HeapAllocationsTimelineDataGridNode = class HeapAllocationsTimeline
         case "name":
             cell.classList.add(...this.iconClassNames());
 
-            let fragment = document.createDocumentFragment();
-            let titleElement = fragment.appendChild(document.createElement("span"));
+            var fragment = document.createDocumentFragment();
+            var titleElement = fragment.appendChild(document.createElement("span"));
             titleElement.textContent = this._data.name;
             if (!this._record.heapSnapshot.invalid) {
-                let goToButton = fragment.appendChild(WebInspector.createGoToArrowButton());
+                var goToButton = fragment.appendChild(WebInspector.createGoToArrowButton());
                 goToButton.addEventListener("click", (event) => {
                     this._heapAllocationsView.showHeapSnapshotTimelineRecord(this._record);
                 });
index 34565f6..e34060e 100644 (file)
@@ -916,7 +916,7 @@ WebInspector.LogContentView = class LogContentView extends WebInspector.ContentV
             var match = searchRegex.exec(text);
             while (match) {
                 numberOfResults++;
-                matchRanges.push({ offset: match.index, length: match[0].length });
+                matchRanges.push({offset: match.index, length: match[0].length});
                 match = searchRegex.exec(text);
             }
 
index ca30568..03d2279 100644 (file)
@@ -53,7 +53,7 @@ WebInspector.OpenResourceDialog = class OpenResourceDialog extends WebInspector.
         this._treeOutline.large = true;
 
         this._treeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange, this._treeSelectionDidChange, this);
-        this._treeOutline.element.addEventListener("focus", () => {this._inputElement.focus();});
+        this._treeOutline.element.addEventListener("focus", () => { this._inputElement.focus(); });
 
         this.element.appendChild(this._treeOutline.element);
 
index 0715333..6ae8e32 100644 (file)
@@ -159,4 +159,4 @@ WebInspector.StyleDetailsPanel = class StyleDetailsPanel extends WebInspector.Vi
 
 WebInspector.StyleDetailsPanel.Event = {
     Refreshed: "style-details-panel-refreshed"
-};
\ No newline at end of file
+};
index eb4b775..a9ce829 100644 (file)
@@ -1126,7 +1126,7 @@ WebInspector.VisualStyleDetailsPanel = class VisualStyleDetailsPanel extends Web
 
         let borderAllSize = new WebInspector.DetailsSectionRow;
 
-        properties.borderStyle = new WebInspector.VisualStyleKeywordPicker(["border-top-style", "border-right-style", "border-bottom-style", "border-left-style"] , WebInspector.UIString("Style"), this._keywords.borderStyle);
+        properties.borderStyle = new WebInspector.VisualStyleKeywordPicker(["border-top-style", "border-right-style", "border-bottom-style", "border-left-style"], WebInspector.UIString("Style"), this._keywords.borderStyle);
         properties.borderStyle.propertyReferenceName = "border-style";
         properties.borderWidth = new WebInspector.VisualStyleNumberInputBox(["border-top-width", "border-right-width", "border-bottom-width", "border-left-width"], WebInspector.UIString("Width"), this._keywords.borderWidth, this._units.defaults);
         properties.borderWidth.propertyReferenceName = "border-width";
@@ -1327,7 +1327,7 @@ WebInspector.VisualStyleDetailsPanel = class VisualStyleDetailsPanel extends Web
 
         let outlineSizeRow = new WebInspector.DetailsSectionRow;
 
-        properties.outlineStyle = new WebInspector.VisualStyleKeywordPicker("outline-style" , WebInspector.UIString("Style"), this._keywords.borderStyle);
+        properties.outlineStyle = new WebInspector.VisualStyleKeywordPicker("outline-style", WebInspector.UIString("Style"), this._keywords.borderStyle);
         properties.outlineWidth = new WebInspector.VisualStyleNumberInputBox("outline-width", WebInspector.UIString("Width"), this._keywords.borderWidth, this._units.defaults);
 
         outlineSizeRow.element.appendChild(properties.outlineStyle.element);
index 68483a2..74fff01 100644 (file)
@@ -90,7 +90,8 @@ WebInspector.VisualStyleKeywordPicker = class VisualStyleKeywordPicker extends W
     }
 
     updateEditorValues(updatedValues)
-    {   if (!updatedValues.conflictingValues) {
+    {
+        if (!updatedValues.conflictingValues) {
             let missing = this._propertyMissing || !updatedValues.value;
             this._unchangedOptionElement.selected = missing;
             this.specialPropertyPlaceholderElement.hidden = !missing;
index 7d13d30..30047c8 100644 (file)
@@ -549,7 +549,7 @@ WebInspector.VisualStylePropertyEditor = class VisualStylePropertyEditor extends
         }
 
         this._element.classList.toggle("missing-dependency", !!title.length);
-        this._warningElement.title = !!title.length ? WebInspector.UIString("Missing Dependencies:%s").format(title) : null;
+        this._warningElement.title = title.length ? WebInspector.UIString("Missing Dependencies:%s").format(title) : null;
     }
 
     _titleElementPrepareForClick(event)
index 443b78c..9bc892e 100644 (file)
@@ -64,7 +64,7 @@ FormatterWorker = class FormatterWorker
             let jsonStringified = JSON.stringify(JSON.parse(sourceText), null, indentString);
             let result = {formattedText: jsonStringified};
             if (includeSourceMapData)
-                result.sourceMapData = {mapping: {original: [], formatted: []}, originalLineEndings:[], formattedLineEndings: []};
+                result.sourceMapData = {mapping: {original: [], formatted: []}, originalLineEndings: [], formattedLineEndings: []};
             return result;
         } catch (e) {}
 
@@ -79,7 +79,7 @@ FormatterWorker = class FormatterWorker
             let formattedTextWithParens = invalidJSONFormatter.formattedText;
             let result = {formattedText: formattedTextWithParens.substring(1, formattedTextWithParens.length - 2)}; // Remove "(" and ")\n".
             if (includeSourceMapData)
-                result.sourceMapData = {mapping: {original: [], formatted: []}, originalLineEndings:[], formattedLineEndings: []};
+                result.sourceMapData = {mapping: {original: [], formatted: []}, originalLineEndings: [], formattedLineEndings: []};
             return result;
         }