diff --git a/.eslintrc.js b/.eslintrc.js index d41c52c98797..7379d8a483ba 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,36 +1,19 @@ "use strict"; module.exports = { - // When adding items to this file please check for effects on sub-directories. + // New rules and configurations should generally be added in + // tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js to + // allow external repositories that use the plugin to pick them up as well. + "extends": [ + "plugin:mozilla/recommended" + ], "plugins": [ "mozilla" ], - "rules": { - "mozilla/avoid-removeChild": "error", - "mozilla/avoid-nsISupportsString-preferences": "error", - "mozilla/import-browser-window-globals": "error", - "mozilla/import-globals": "warn", - "mozilla/no-import-into-var-and-global": "error", - "mozilla/no-useless-parameters": "error", - "mozilla/no-useless-removeEventListener": "error", - "mozilla/use-default-preference-values": "error", - "mozilla/use-ownerGlobal": "error", - // No (!foo in bar) or (!object instanceof Class) - "no-unsafe-negation": "error", - // No eval() and no strings in the first param of setTimeout or setInterval - "no-implied-eval": "error", - "no-eval": "error", - }, // The html plugin is enabled via a command line option on eslint. To avoid // bad interactions with the xml preprocessor in eslint-plugin-mozilla, we // turn off processing of the html plugin for .xml files. "settings": { "html/xml-extensions": [ ".xhtml" ] }, - "env": { - "es6": true - }, - "parserOptions": { - "ecmaVersion": 8, - }, }; diff --git a/accessible/.eslintrc.js b/accessible/.eslintrc.js index 887fd4770dc1..6e9f7a2e35d2 100644 --- a/accessible/.eslintrc.js +++ b/accessible/.eslintrc.js @@ -1,9 +1,6 @@ "use strict"; module.exports = { - "extends": [ - "plugin:mozilla/recommended" - ], "rules": { // Warn about cyclomatic complexity in functions. "complexity": ["error", 42], diff --git a/browser/.eslintrc.js b/browser/.eslintrc.js index 856a17e0cf97..1cdede3f1b7c 100644 --- a/browser/.eslintrc.js +++ b/browser/.eslintrc.js @@ -1,10 +1,6 @@ "use strict"; module.exports = { - "extends": [ - "plugin:mozilla/recommended" - ], - "rules": { // XXX Bug 1326071 - This should be reduced down - probably to 20 or to // be removed & synced with the mozilla/recommended value. diff --git a/caps/.eslintrc.js b/caps/.eslintrc.js deleted file mode 100644 index 810a54bd55f7..000000000000 --- a/caps/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -module.exports = { - "extends": [ - "plugin:mozilla/recommended" - ] -}; diff --git a/dom/indexedDB/test/.eslintrc.js b/dom/indexedDB/test/.eslintrc.js index 22dcddd1f510..2f3ea6a3aa40 100644 --- a/dom/indexedDB/test/.eslintrc.js +++ b/dom/indexedDB/test/.eslintrc.js @@ -2,7 +2,6 @@ module.exports = { "extends": [ - "plugin:mozilla/recommended", "plugin:mozilla/browser-test", "plugin:mozilla/chrome-test", "plugin:mozilla/mochitest-test", diff --git a/js/src/builtin/.eslintrc.js b/js/src/builtin/.eslintrc.js index 458f725de206..2df086436ed9 100644 --- a/js/src/builtin/.eslintrc.js +++ b/js/src/builtin/.eslintrc.js @@ -1,10 +1,6 @@ "use strict"; module.exports = { - "extends": [ - "plugin:mozilla/recommended" - ], - "plugins": [ "spidermonkey-js" ], diff --git a/js/src/shell/.eslintrc.js b/js/src/shell/.eslintrc.js index fb19390940ae..a44eb3dae311 100644 --- a/js/src/shell/.eslintrc.js +++ b/js/src/shell/.eslintrc.js @@ -1,10 +1,6 @@ "use strict"; module.exports = { - "extends": [ - "plugin:mozilla/recommended" - ], - "rules": { // SpiderMonkey's style doesn't match any of the possible options. "brace-style": "off", diff --git a/mobile/android/.eslintrc.js b/mobile/android/.eslintrc.js index 11524b0d8492..c3ccaa180729 100644 --- a/mobile/android/.eslintrc.js +++ b/mobile/android/.eslintrc.js @@ -1,10 +1,6 @@ "use strict"; module.exports = { - extends: [ - "plugin:mozilla/recommended" - ], - globals: { // TODO: Create custom rule for `Cu.import` "AddonManager": false, diff --git a/security/.eslintrc.js b/security/.eslintrc.js index ea9475bc379a..65c520604912 100644 --- a/security/.eslintrc.js +++ b/security/.eslintrc.js @@ -1,9 +1,6 @@ "use strict"; module.exports = { - "extends": [ - "plugin:mozilla/recommended" - ], "rules": { // Enforce return statements in callbacks of array methods. "array-callback-return": "error", diff --git a/services/.eslintrc.js b/services/.eslintrc.js index 0c441ce41635..30dfbdebfbb7 100644 --- a/services/.eslintrc.js +++ b/services/.eslintrc.js @@ -1,10 +1,6 @@ "use strict"; module.exports = { - extends: [ - "plugin:mozilla/recommended" - ], - plugins: [ "mozilla" ] diff --git a/storage/.eslintrc.js b/storage/.eslintrc.js deleted file mode 100644 index 1315af97f9fb..000000000000 --- a/storage/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -module.exports = { - "extends": [ - "plugin:mozilla/recommended" - ], -}; diff --git a/taskcluster/docker/index-task/.eslintrc.js b/taskcluster/docker/index-task/.eslintrc.js index 26e10cb2ef2d..0775c5797dc8 100644 --- a/taskcluster/docker/index-task/.eslintrc.js +++ b/taskcluster/docker/index-task/.eslintrc.js @@ -1,14 +1,6 @@ "use strict"; module.exports = { - "extends": [ - "plugin:mozilla/recommended" - ], - - "plugins": [ - "mozilla" - ], - "env": { "node": true } diff --git a/toolkit/.eslintrc.js b/toolkit/.eslintrc.js index e668160ce114..e24bc6285f62 100644 --- a/toolkit/.eslintrc.js +++ b/toolkit/.eslintrc.js @@ -1,10 +1,6 @@ "use strict"; module.exports = { - extends: [ - "plugin:mozilla/recommended" - ], - rules: { // XXX Bug 1326071 - This should be reduced down - probably to 20 or to // be removed & synced with the mozilla/recommended value. diff --git a/tools/.eslintrc.js b/tools/.eslintrc.js deleted file mode 100644 index 0c441ce41635..000000000000 --- a/tools/.eslintrc.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -module.exports = { - extends: [ - "plugin:mozilla/recommended" - ], - - plugins: [ - "mozilla" - ] -} diff --git a/tools/lint/eslint/.eslintrc.js b/tools/lint/eslint/.eslintrc.js index b30a8b361db3..8bcbe53022de 100644 --- a/tools/lint/eslint/.eslintrc.js +++ b/tools/lint/eslint/.eslintrc.js @@ -14,14 +14,6 @@ module.exports = { "node": true }, - "plugins": [ - "mozilla" - ], - - "extends": [ - "plugin:mozilla/recommended" - ], - "rules": { "camelcase": "error", "comma-dangle": ["error", "never"],