Bug 1434449 - Enable no-unused-vars for the global (as well as local) scope on jsm files, whitelist directories still to be fixed. r=florian.
authorMark Banner <standard8@mozilla.com>
Tue, 30 Jan 2018 22:10:08 +0000
changeset 456672 8552acda5ec771a5c1873ed9222097727ef3cea8
parent 456671 5250ade2161b1a34b29aadb06376a6986fcbd03c
child 456673 7547f9d42895db2f4d568063e748d0bf6888a098
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1434449
milestone60.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 1434449 - Enable no-unused-vars for the global (as well as local) scope on jsm files, whitelist directories still to be fixed. r=florian. MozReview-Commit-ID: 3vBWDR3UjGF
.eslintrc.js
tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
tools/lint/eslint/eslint-plugin-mozilla/package-lock.json
tools/lint/eslint/eslint-plugin-mozilla/package.json
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -34,10 +34,28 @@ module.exports = {
       "devtools/**",
       "extensions/pref/**",
       "mobile/android/**",
       "testing/**",
     ],
     "rules": {
       "mozilla/use-services": "off",
     }
+  }, {
+    // XXX Bug 1434446. These directories have jsm files still being fixed, so
+    // turn off global no-unused-vars checking for them.
+    "files": [
+      "accessible/**/*.jsm",
+      "browser/components/**/*.jsm",
+      "browser/extensions/**/*.jsm",
+      "services/sync/**/*.jsm",
+      "toolkit/**/*.jsm",
+    ],
+    "rules": {
+      "mozilla/mark-exported-symbols-as-used": "error",
+      "no-unused-vars": ["error", {
+        "args": "none",
+        "vars": "local",
+        "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS"
+      }]
+    }
   }]
 };
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
@@ -65,22 +65,22 @@ module.exports = {
   }, {
     // Turn off browser env for all *.jsm files, and turn on the jsm environment.
     "env": {
       "browser": false,
       "mozilla/jsm": true
     },
     "files": "**/*.jsm",
     "rules": {
-      "mozilla/mark-exported-symbols-as-used": "error"
-      // "no-unused-vars": ["error", {
-      //   "args": "none",
-      //   "vars": "all",
-      //   "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS"
-      // }]
+      "mozilla/mark-exported-symbols-as-used": "error",
+      "no-unused-vars": ["error", {
+        "args": "none",
+        "vars": "all",
+        "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS"
+      }]
     }
   }],
 
   "parserOptions": {
     "ecmaFeatures": {
       "experimentalObjectRestSpread": true
     },
     "ecmaVersion": 8
--- a/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json
+++ b/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json
@@ -1,11 +1,11 @@
 {
   "name": "eslint-plugin-mozilla",
-  "version": "0.6.0",
+  "version": "0.7.0",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
     "acorn": {
       "version": "5.2.1",
       "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz",
       "integrity": "sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w==",
       "dev": 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.6.0",
+  "version": "0.7.0",
   "description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.",
   "keywords": [
     "eslint",
     "eslintplugin",
     "eslint-plugin",
     "mozilla",
     "firefox"
   ],