Title: [173492] trunk/Source/WebInspectorUI
Revision
173492
Author
[email protected]
Date
2014-09-10 15:13:59 -0700 (Wed, 10 Sep 2014)

Log Message

Web Inspector: Fix obscure ESLint warnings and skip directories
https://bugs.webkit.org/show_bug.cgi?id=136686

Reviewed by Timothy Hatcher.

* .eslintignore: Added.
Skip directories we do not want ESLint to process.

* .eslintrc:
Add rules we've seen and sort sections.

* UserInterface/Controllers/FormatterContentBuilder.js:
(FormatterContentBuilder.prototype._appendIndent):
* UserInterface/Models/Color.js:
* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype._parseStyleDeclarationPayload):
* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
* UserInterface/Views/DOMTreeDataGridNode.js:
* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype.ondelete):
(WebInspector.DOMTreeElement.prototype._insertInLastAttributePosition):
(WebInspector.DOMTreeElement.prototype._distinctClosingTagElement):
* UserInterface/Views/EditingSupport.js:
(WebInspector.EditingConfig):
* UserInterface/Views/LayerTreeDataGridNode.js:
(WebInspector.LayerTreeDataGridNode.prototype._makeOutlet):
* UserInterface/Views/TreeOutline.js:
(TreeOutline.prototype.appendChild):
(TreeOutline.prototype.insertChild):
(TreeOutline.prototype.removeChildAtIndex):
(TreeOutline.prototype.removeChild):
(TreeElement.prototype.expandRecursively):
Fix linter issues.

Modified Paths

Added Paths

Diff

Added: trunk/Source/WebInspectorUI/.eslintignore (0 => 173492)


--- trunk/Source/WebInspectorUI/.eslintignore	                        (rev 0)
+++ trunk/Source/WebInspectorUI/.eslintignore	2014-09-10 22:13:59 UTC (rev 173492)
@@ -0,0 +1,3 @@
+Localizations
+Tools
+UserInterface/External

Modified: trunk/Source/WebInspectorUI/.eslintrc (173491 => 173492)


--- trunk/Source/WebInspectorUI/.eslintrc	2014-09-10 21:55:01 UTC (rev 173491)
+++ trunk/Source/WebInspectorUI/.eslintrc	2014-09-10 22:13:59 UTC (rev 173492)
@@ -26,19 +26,18 @@
 {
     "env": {
         "browser": true,
-        "node": false
+        "node": false,
     },
     "globals": {
-        "console": true,
         "ApplicationCacheAgent": true,
+        "CSSAgent": true,
         "CodeMirror": true,
         "ConsoleAgent": true,
-        "CSSAgent": true,
-        "DatabaseAgent": true,
-        "DebuggerAgent": true,
         "DOMAgent": true,
         "DOMDebuggerAgent": true,
         "DOMStorageAgent": true,
+        "DatabaseAgent": true,
+        "DebuggerAgent": true,
         "Formatter": true,
         "IndexedDBAgent": true,
         "InspectorAgent": true,
@@ -53,17 +52,29 @@
         "RuntimeAgent": true,
         "TimelineAgent": true,
         "WebInspector": true,
-        "WorkerAgent": true
+        "WorkerAgent": true,
+        "console": true,
     },
     "rules": {
+        "consistent-return": 2,
+        "curly": 0,
         "eqeqeq": 2,
-        "curly": 0,
-        "consistent-return": 2,
+        "new-parens": 0,
+        "no-comma-dangle": 0,
+        "no-console": 0,
+        "no-constant-condition": 0,
         "no-extra-semi": 2,
-        "quotes": [2, "double"],
+        "no-proto": 0,
+        "no-return-assign": 2,
         "no-trailing-spaces": 2,
         "no-underscore-dangle": 0,
-        "new-parens": 0,
-        "semi": 2
+        "no-unused-expressions": 2,
+        "no-wrap-func": 2,
+        "quotes": [2, "double"],
+        "semi": 2,
+        "space-infix-ops": 2,
+        "space-return-throw-case": 2,
+        "strict": 0,
+        "valid-typeof": 2,
     }
 }

Modified: trunk/Source/WebInspectorUI/ChangeLog (173491 => 173492)


--- trunk/Source/WebInspectorUI/ChangeLog	2014-09-10 21:55:01 UTC (rev 173491)
+++ trunk/Source/WebInspectorUI/ChangeLog	2014-09-10 22:13:59 UTC (rev 173492)
@@ -1,5 +1,41 @@
 2014-09-10  Joseph Pecoraro  <[email protected]>
 
+        Web Inspector: Fix obscure ESLint warnings and skip directories
+        https://bugs.webkit.org/show_bug.cgi?id=136686
+
+        Reviewed by Timothy Hatcher.
+
+        * .eslintignore: Added.
+        Skip directories we do not want ESLint to process.
+
+        * .eslintrc:
+        Add rules we've seen and sort sections.
+
+        * UserInterface/Controllers/FormatterContentBuilder.js:
+        (FormatterContentBuilder.prototype._appendIndent):
+        * UserInterface/Models/Color.js:
+        * UserInterface/Models/DOMNodeStyles.js:
+        (WebInspector.DOMNodeStyles.prototype._parseStyleDeclarationPayload):
+        * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
+        * UserInterface/Views/DOMTreeDataGridNode.js:
+        * UserInterface/Views/DOMTreeElement.js:
+        (WebInspector.DOMTreeElement.prototype.ondelete):
+        (WebInspector.DOMTreeElement.prototype._insertInLastAttributePosition):
+        (WebInspector.DOMTreeElement.prototype._distinctClosingTagElement):
+        * UserInterface/Views/EditingSupport.js:
+        (WebInspector.EditingConfig):
+        * UserInterface/Views/LayerTreeDataGridNode.js:
+        (WebInspector.LayerTreeDataGridNode.prototype._makeOutlet):
+        * UserInterface/Views/TreeOutline.js:
+        (TreeOutline.prototype.appendChild):
+        (TreeOutline.prototype.insertChild):
+        (TreeOutline.prototype.removeChildAtIndex):
+        (TreeOutline.prototype.removeChild):
+        (TreeElement.prototype.expandRecursively):
+        Fix linter issues.
+
+2014-09-10  Joseph Pecoraro  <[email protected]>
+
         Web Inspector: Fix ESLint consistent-return warnings
         https://bugs.webkit.org/show_bug.cgi?id=136682
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/FormatterContentBuilder.js (173491 => 173492)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/FormatterContentBuilder.js	2014-09-10 21:55:01 UTC (rev 173491)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/FormatterContentBuilder.js	2014-09-10 22:13:59 UTC (rev 173492)
@@ -196,7 +196,7 @@
         const maxCacheIndent = 20;
         var max = Math.min(this._indent, maxCacheIndent);
         for (var i = this._indentCache.length; i <= max; ++i)
-            this._indentCache[i] = this._indentCache[i-1] + this._indentString;
+            this._indentCache[i] = this._indentCache[i - 1] + this._indentString;
 
         // Append indents as needed.
         var indent = this._indent;

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/Color.js (173491 => 173492)


--- trunk/Source/WebInspectorUI/UserInterface/Models/Color.js	2014-09-10 21:55:01 UTC (rev 173491)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Color.js	2014-09-10 22:13:59 UTC (rev 173492)
@@ -430,9 +430,9 @@
             l + s
         ];
         return [
-            Math.round(sArray[ ~~h    % 6 ] * 255),
-            Math.round(sArray[ (h|16) % 6 ] * 255),
-            Math.round(sArray[ (h|8)  % 6 ] * 255)
+            Math.round(sArray[ ~~h      % 6 ] * 255),
+            Math.round(sArray[ (h | 16) % 6 ] * 255),
+            Math.round(sArray[ (h | 8)  % 6 ] * 255)
         ];
     },
 
@@ -622,7 +622,7 @@
     if (max === 0)
         s = 0;
     else
-        s = 1 - (min/max);
+        s = 1 - (min / max);
 
     return [h, s, v];
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js (173491 => 173492)


--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js	2014-09-10 21:55:01 UTC (rev 173491)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js	2014-09-10 22:13:59 UTC (rev 173492)
@@ -692,7 +692,7 @@
 
         if (previousStyleDeclarationsMap !== this._styleDeclarationsMap) {
             // If the previous and current maps differ then make sure the found styleDeclaration is added to the current map.
-            styleDeclarations = mapKey && mapKey in this._styleDeclarationsMap ? this._styleDeclarationsMap[mapKey] : [] ;
+            styleDeclarations = mapKey && mapKey in this._styleDeclarationsMap ? this._styleDeclarationsMap[mapKey] : [];
 
             if (styleDeclaration && !styleDeclarations.contains(styleDeclaration)) {
                 styleDeclarations.push(styleDeclaration);

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js (173491 => 173492)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js	2014-09-10 21:55:01 UTC (rev 173491)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js	2014-09-10 22:13:59 UTC (rev 173492)
@@ -530,9 +530,9 @@
 
         if (!onlyVisibleProperties) {
             // Filter based on options only when all properties are used.
-            properties = properties.filter((function(property) {
+            properties = properties.filter(function(property) {
                 return !property.implicit || this._showsImplicitProperties || property.canonicalName in this._alwaysShowPropertyNames;
-            }).bind(this));
+            }, this);
 
             if (this._sortProperties)
                 properties.sort(function(a, b) { return a.name.localeCompare(b.name); });

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGridNode.js (173491 => 173492)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGridNode.js	2014-09-10 21:55:01 UTC (rev 173491)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeDataGridNode.js	2014-09-10 22:13:59 UTC (rev 173492)
@@ -86,4 +86,3 @@
         WebInspector.resourceSidebarPanel.showMainFrameDOMTree(this._domNode, true);
     }
 };
-

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js (173491 => 173492)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js	2014-09-10 21:55:01 UTC (rev 173491)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js	2014-09-10 22:13:59 UTC (rev 173492)
@@ -479,7 +479,10 @@
     ondelete: function()
     {
         var startTagTreeElement = this.treeOutline.findTreeElement(this.representedObject);
-        startTagTreeElement ? startTagTreeElement.remove() : this.remove();
+        if (startTagTreeElement)
+            startTagTreeElement.remove();
+        else
+            this.remove();
         return true;
     },
 
@@ -527,7 +530,7 @@
         else {
             var nodeName = tag.textContent.match(/^<(.*?)>$/)[1];
             tag.textContent = "";
-            tag.appendChild(document.createTextNode("<"+nodeName));
+            tag.appendChild(document.createTextNode("<" + nodeName));
             tag.appendChild(node);
             tag.appendChild(document.createTextNode(">"));
         }
@@ -962,14 +965,14 @@
         // in the child element list.
         if (this.expanded) {
             var closers = this._childrenListNode.querySelectorAll(".close");
-            return closers[closers.length-1];
+            return closers[closers.length - 1];
         }
 
         // Remaining cases are single line non-expanded elements with a closing
         // tag, or HTML elements without a closing tag (such as <br>). Return
         // null in the case where there isn't a closing tag.
         var tags = this.listItemElement.getElementsByClassName("html-tag");
-        return (tags.length === 1 ? null : tags[tags.length-1]);
+        return (tags.length === 1 ? null : tags[tags.length - 1]);
     },
 
     updateTitle: function(onlySearchQueryChanged)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/EditingSupport.js (173491 => 173492)


--- trunk/Source/WebInspectorUI/UserInterface/Views/EditingSupport.js	2014-09-10 21:55:01 UTC (rev 173491)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/EditingSupport.js	2014-09-10 22:13:59 UTC (rev 173492)
@@ -79,9 +79,6 @@
     this.commitHandler = commitHandler;
     this.cancelHandler = cancelHandler;
     this.context = context;
-    this.pasteHandler;
-    this.multiline;
-    this.customFinishHandler;
     this.spellcheck = false;
 };
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDataGridNode.js (173491 => 173492)


--- trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDataGridNode.js	2014-09-10 21:55:01 UTC (rev 173491)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDataGridNode.js	2014-09-10 22:13:59 UTC (rev 173492)
@@ -92,7 +92,8 @@
 
     _makeOutlet: function(name, element)
     {
-        return this._outlets[name] = element;
+        this._outlets[name] = element;
+        return element;
     },
 
     _makeNameCell: function()

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js (173491 => 173492)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2014-09-10 21:55:01 UTC (rev 173491)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2014-09-10 22:13:59 UTC (rev 173492)
@@ -56,7 +56,7 @@
 TreeOutline.prototype.appendChild = function(child)
 {
     if (!child)
-        throw("child can't be undefined or null");
+        throw "child can't be undefined or null";
 
     var lastChild = this.children[this.children.length - 1];
     if (lastChild) {
@@ -98,7 +98,7 @@
 TreeOutline.prototype.insertChild = function(child, index)
 {
     if (!child)
-        throw("child can't be undefined or null");
+        throw "child can't be undefined or null";
 
     var previousChild = (index > 0 ? this.children[index - 1] : null);
     if (previousChild) {
@@ -147,7 +147,7 @@
 TreeOutline.prototype.removeChildAtIndex = function(childIndex, suppressOnDeselect, suppressSelectSibling)
 {
     if (childIndex < 0 || childIndex >= this.children.length)
-        throw("childIndex out of range");
+        throw "childIndex out of range";
 
     var child = this.children[childIndex];
     this.children.splice(childIndex, 1);
@@ -185,11 +185,11 @@
 TreeOutline.prototype.removeChild = function(child, suppressOnDeselect, suppressSelectSibling)
 {
     if (!child)
-        throw("child can't be undefined or null");
+        throw "child can't be undefined or null";
 
     var childIndex = this.children.indexOf(child);
     if (childIndex === -1)
-        throw("child not found in this node's children");
+        throw "child not found in this node's children";
 
     this.removeChildAtIndex(childIndex, suppressOnDeselect, suppressSelectSibling);
 };
@@ -869,7 +869,7 @@
     // The Inspector uses TreeOutlines to represents object properties, so recursive expansion
     // in some case can be infinite, since _javascript_ objects can hold circular references.
     // So default to a recursion cap of 3 levels, since that gives fairly good results.
-    if (typeof maxDepth === "undefined" || typeof maxDepth === "null")
+    if (maxDepth === undefined)
         maxDepth = 3;
 
     while (item) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to