Enable no-global-assign lint rule
This actually caught an issue in ElementsTestRunner.js.
Bug: chromium:1057042
Change-Id: I850156e6b7956fe9b24295eb084e5b228113bda9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2201178
Reviewed-by: Tim van der Lippe <[email protected]>
Reviewed-by: Yang Guo <[email protected]>
Commit-Queue: Mathias Bynens <[email protected]>
diff --git a/.eslintrc.js b/.eslintrc.js
index 670ea69..6b889eb 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -58,6 +58,7 @@
'no-duplicate-case': 2,
'no-else-return': [2, {'allowElseIf': false}],
'no-empty-character-class': 2,
+ 'no-global-assign': 2,
'no-implied-eval': 2,
'no-labels': 2,
'no-multi-str': 2,
diff --git a/front_end/animation/animation-legacy.js b/front_end/animation/animation-legacy.js
index 4c65c7b..7c46b45 100644
--- a/front_end/animation/animation-legacy.js
+++ b/front_end/animation/animation-legacy.js
@@ -5,6 +5,7 @@
import * as AnimationModule from './animation.js';
self.Animation = self.Animation || {};
+/* global Animation:writable */
Animation = Animation || {};
/**
diff --git a/front_end/elements_test_runner/ElementsTestRunner.js b/front_end/elements_test_runner/ElementsTestRunner.js
index 8f9fc19..435c79e 100644
--- a/front_end/elements_test_runner/ElementsTestRunner.js
+++ b/front_end/elements_test_runner/ElementsTestRunner.js
@@ -831,7 +831,7 @@
if (classList.contains('webkit-html-attribute-name')) {
xpath += '/@' + element.textContent + ' (empty)';
} else if (classList.contains('webkit-html-attribute-value')) {
- name = element.parentElement.querySelector('.webkit-html-attribute-name').textContent;
+ const name = element.parentElement.querySelector('.webkit-html-attribute-name').textContent;
xpath += '/@' + name + ' ' + element.textContent;
} else if (classList.contains('webkit-html-text-node')) {
xpath += '/text() "' + element.textContent + '"';