From 9a2172526a3a145b2915f334a4a1385e5e3e34c5 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Tue, 30 Jan 2018 22:10:08 +0000 Subject: [PATCH] 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 --HG-- extra : rebase_source : 61495d14a8d761e71b4072b02e2ca57e77f44059 --- .eslintrc.js | 18 ++++++++++++++++++ .../lib/configs/recommended.js | 12 ++++++------ .../eslint-plugin-mozilla/package-lock.json | 2 +- .../eslint/eslint-plugin-mozilla/package.json | 2 +- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index c7e6f6487149a..aa48cde02f41e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -39,5 +39,23 @@ module.exports = { "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" + }] + } }] }; diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js index 7240366185fea..7a1d0764cf597 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js @@ -70,12 +70,12 @@ module.exports = { }, "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" + }] } }], diff --git a/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json b/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json index e0414432d5811..3a332c0e22dd8 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json +++ b/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-mozilla", - "version": "0.6.0", + "version": "0.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/tools/lint/eslint/eslint-plugin-mozilla/package.json b/tools/lint/eslint/eslint-plugin-mozilla/package.json index 099fad1a8d9bc..7c964f18353b0 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/package.json +++ b/tools/lint/eslint/eslint-plugin-mozilla/package.json @@ -1,6 +1,6 @@ { "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",