Bug 1562956 - eslint: allow dash in tag names in xul documents;r=Standard8
authorBrian Grinstead <bgrinstead@mozilla.com>
Thu, 04 Jul 2019 11:18:47 +0000
changeset 544135 8b928b1224c7fe04f89d04170ec54b5d5c6ed61f
parent 544090 91ec7cffedbaa59b3a1856da1401f307f94e0155
child 544136 877ce94bb4fd73ce1c51f5e221125ca3f66b3482
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1562956
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1562956 - eslint: allow dash in tag names in xul documents;r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D36808
tools/lint/eslint/eslint-plugin-mozilla/lib/processors/xul.js
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/processors/xul.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/processors/xul.js
@@ -134,17 +134,18 @@ function addSyntheticLine(line, linePos,
 
 function recursiveExpand(node) {
   for (let [attr, value] of Object.entries(node.attributes)) {
     if (attr.startsWith("on")) {
       if (attr == "oncommand" && value == ";") {
         // Ignore these, see bug 371900 for why people might do this.
         continue;
       }
-      let nodeDesc = node.local;
+      // Ignore dashes in the tag name
+      let nodeDesc = node.local.replace(/-/g, "");
       if (node.attributes.id) {
         nodeDesc += "_" + node.attributes.id.replace(/[^a-z]/gi, "_");
       }
       if (node.attributes.class) {
         nodeDesc += "_" + node.attributes.class.replace(/[^a-z]/gi, "_");
       }
       addSyntheticLine("function " + nodeDesc + "(event) {", node.textLine);
       let processedLines = value.split(/\r?\n/);