From b2df945d372dffc9b8ec4556acd9bdd8b8fb3cab Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Sat, 7 Mar 2020 09:30:44 +0000 Subject: [PATCH] Bug 1620542 - Turn on linting of .eslintrc.js files. r=mossop Differential Revision: https://phabricator.services.mozilla.com/D65704 --HG-- extra : moz-landing-system : lando --- .eslintignore | 2 ++ .eslintrc.js | 10 ++++++++++ browser/components/newtab/content-src/.eslintrc.js | 2 ++ browser/components/newtab/test/.eslintrc.js | 2 ++ devtools/platform/tests/xpcshell/.eslintrc.js | 2 ++ 5 files changed, 18 insertions(+) diff --git a/.eslintignore b/.eslintignore index fa39216ddd5b..8540df36298f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,6 +7,8 @@ # - intentionally invalid files # - build directories and other items that we need to ignore +!.eslintrc.js + # Always ignore node_modules. **/node_modules/ diff --git a/.eslintrc.js b/.eslintrc.js index 9c4f693a0b85..c5761820bc9f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -59,6 +59,16 @@ module.exports = { extends: ["plugin:mozilla/recommended"], plugins: ["mozilla"], overrides: [ + { + // All .eslintrc.js files are in the node environment, so turn that + // on here. + // https://github.com/eslint/eslint/issues/13008 + files: [".eslintrc.js"], + env: { + node: true, + browser: false, + }, + }, { files: [ "*.html", diff --git a/browser/components/newtab/content-src/.eslintrc.js b/browser/components/newtab/content-src/.eslintrc.js index 8df1fb958758..0733d6ce2836 100644 --- a/browser/components/newtab/content-src/.eslintrc.js +++ b/browser/components/newtab/content-src/.eslintrc.js @@ -1,3 +1,5 @@ +/* eslint-disable import/no-commonjs */ + module.exports = { rules: { "import/no-commonjs": 2, diff --git a/browser/components/newtab/test/.eslintrc.js b/browser/components/newtab/test/.eslintrc.js index 7717b0856c28..621f781337aa 100644 --- a/browser/components/newtab/test/.eslintrc.js +++ b/browser/components/newtab/test/.eslintrc.js @@ -1,3 +1,5 @@ +/* eslint-disable import/no-commonjs */ + module.exports = { env: { mocha: true, diff --git a/devtools/platform/tests/xpcshell/.eslintrc.js b/devtools/platform/tests/xpcshell/.eslintrc.js index 0f2ff6c1d616..dc7f2c85c421 100644 --- a/devtools/platform/tests/xpcshell/.eslintrc.js +++ b/devtools/platform/tests/xpcshell/.eslintrc.js @@ -1,3 +1,5 @@ +"use strict"; + // Parent config file for all devtools xpcshell files. module.exports = { extends: ["plugin:mozilla/xpcshell-test"],