Bug 1330464 - make no-useless-parameters.js not use array.includes, r=jaws over IRC.
authorFlorian Quèze <florian@queze.net>
Fri, 13 Jan 2017 21:21:16 +0100
changeset 374416 d94f6ca9e7521922c75c34108efcc793685e8c96
parent 374415 4bbe0c7e648909d6118e9cc4eea14296569db80b
child 374417 6e97457f78bd19c0935d9a105833a84760a4b408
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1330464
milestone53.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 1330464 - make no-useless-parameters.js not use array.includes, r=jaws over IRC.
tools/lint/eslint/eslint-plugin-mozilla/lib/rules/no-useless-parameters.js
tools/lint/eslint/eslint-plugin-mozilla/package.json
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/no-useless-parameters.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/no-useless-parameters.js
@@ -24,18 +24,19 @@ module.exports = function(context) {
   return {
     "CallExpression": function(node) {
       let callee = node.callee;
       if (callee.type !== "MemberExpression" ||
           callee.property.type !== "Identifier") {
         return;
       }
 
-      if (["getCharPref", "getBoolPref", "getIntPref", "clearUserPref"]
-          .includes(callee.property.name) && node.arguments.length > 1) {
+      if ((["getCharPref", "getBoolPref", "getIntPref", "clearUserPref"]
+           .indexOf(callee.property.name) != -1) &&
+          node.arguments.length > 1) {
         context.report(node, callee.property.name + " takes only 1 parameter.");
       }
 
       if (callee.property.name === "removeObserver" &&
           node.arguments.length === 3) {
         let arg = node.arguments[2];
         if (arg.type === "Literal" && (arg.value === false ||
                                        arg.value === true)) {
--- a/tools/lint/eslint/eslint-plugin-mozilla/package.json
+++ b/tools/lint/eslint/eslint-plugin-mozilla/package.json
@@ -1,11 +1,11 @@
 {
   "name": "eslint-plugin-mozilla",
-  "version": "0.2.9",
+  "version": "0.2.10",
   "description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.",
   "keywords": [
     "eslint",
     "eslintplugin",
     "eslint-plugin",
     "mozilla",
     "firefox"
   ],