diff --git a/.eslintrc.js b/.eslintrc.js index 66eceab04aa4..32f95ec78773 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -24,5 +24,27 @@ module.exports = { "rules": { "eol-last": "off", } + }, { + // XXX Bug 1421969. These files/directories are still being fixed, + // so turn off mozilla/use-services for them for now. + "files": [ + "accessible/**", + // Browser: Bug 1421379 + "browser/extensions/shield-recipe-client/test/browser/head.js", + "browser/modules/offlineAppCache.jsm", + "chrome/**", + "devtools/**", + "dom/indexedDB/**", + "dom/media/**", + "extensions/pref/**", + "mobile/android/**", + "security/**", + "testing/**", + "tools/profiler/**", + "xpcom/**" + ], + "rules": { + "mozilla/use-services": "off", + } }] }; diff --git a/browser/components/.eslintrc.js b/browser/components/.eslintrc.js index 2510d52c938f..1444a7a8ad74 100644 --- a/browser/components/.eslintrc.js +++ b/browser/components/.eslintrc.js @@ -5,7 +5,5 @@ module.exports = { // XXX Bug 1326071 - This should be reduced down - probably to 20 or to // be removed & synced with the mozilla/recommended value. "complexity": ["error", 61], - - "mozilla/use-services": "error", } }; diff --git a/services/.eslintrc.js b/services/.eslintrc.js index 212b5eaaf3a7..120e4d5de523 100644 --- a/services/.eslintrc.js +++ b/services/.eslintrc.js @@ -6,7 +6,5 @@ module.exports = { ], "rules": { "no-throw-literal": 2, - - "mozilla/use-services": "error", }, } diff --git a/toolkit/.eslintrc.js b/toolkit/.eslintrc.js index 8cb39d572bd3..e24bc6285f62 100644 --- a/toolkit/.eslintrc.js +++ b/toolkit/.eslintrc.js @@ -7,16 +7,5 @@ module.exports = { "complexity": ["error", 41], "mozilla/no-task": "error", - - "mozilla/use-services": "error", - }, - - "overrides": [{ - // Turn off use-services for xml files. XBL bindings are going away, and - // working out the valid globals for those is difficult. - "files": "**/*.xml", - "rules": { - "mozilla/use-services": "off", - } - }] + } }; 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 2e5dfa3c574e..5e1e72aba432 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js @@ -56,6 +56,15 @@ module.exports = { "uneval": false }, + "overrides": [{ + // Turn off use-services for xml files. XBL bindings are going away, and + // working out the valid globals for those is difficult. + "files": "**/*.xml", + "rules": { + "mozilla/use-services": "off" + } + }], + "parserOptions": { "ecmaFeatures": { "experimentalObjectRestSpread": true @@ -148,6 +157,7 @@ module.exports = { "mozilla/no-useless-removeEventListener": "error", "mozilla/use-default-preference-values": "error", "mozilla/use-ownerGlobal": "error", + "mozilla/use-services": "error", // Always require parenthesis for new calls // "new-parens": "error", diff --git a/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json b/tools/lint/eslint/eslint-plugin-mozilla/package-lock.json index 5cf835ed76f7..8486009a7ee8 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.4.9", + "version": "0.4.10", "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 6fe49f8d3ce1..c75a27e5b4a4 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.4.9", + "version": "0.4.10", "description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.", "keywords": [ "eslint",