Skip to content

Commit 239ead3

Browse files
committed
Bug 1878553 - Define *.config.(m)js files as node based for ESLint. r=mossop,devtools-reviewers,omc-reviewers,nchevobbe,aminomancer
Differential Revision: https://phabricator.services.mozilla.com/D200582
1 parent cc826a2 commit 239ead3

File tree

11 files changed

+13
-18
lines changed

11 files changed

+13
-18
lines changed

.eslintrc.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,15 @@ module.exports = {
6868
plugins: ["mozilla", "import", "json"],
6969
overrides: [
7070
{
71-
// All .eslintrc.js files are in the node environment, so turn that
72-
// on here.
73-
// https://github.com/eslint/eslint/issues/13008
74-
files: [".eslintrc.js"],
71+
files: [
72+
// All .eslintrc.js files are in the node environment, so turn that
73+
// on here.
74+
// https://github.com/eslint/eslint/issues/13008
75+
".eslintrc.js",
76+
// *.config.js files are generally assumed to be configuration files
77+
// based for node.
78+
"*.config.?(m)js",
79+
],
7580
env: {
7681
node: true,
7782
browser: false,

browser/components/aboutwelcome/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = {
4343
},
4444
},
4545
{
46-
files: ["./*.js", "content-src/**", "tests/unit/**"],
46+
files: ["content-src/**", "tests/unit/**"],
4747
env: {
4848
node: true,
4949
},

browser/components/asrouter/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
},
2727
},
2828
{
29-
files: ["bin/**", "./*.js", "content-src/**", "tests/unit/**"],
29+
files: ["bin/**", "content-src/**", "tests/unit/**"],
3030
env: {
3131
node: true,
3232
},

browser/components/newtab/.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ module.exports = {
5252
files: [
5353
"bin/**",
5454
"content-src/**",
55-
"./*.js",
5655
"loaders/**",
5756
"tools/**",
5857
"test/unit/**",

browser/components/pocket/webpack.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* This Source Code Form is subject to the terms of the Mozilla Public
22
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
33
* You can obtain one at http://mozilla.org/MPL/2.0/. */
4-
/* eslint-env node */
54

65
module.exports = {
76
mode: "production",

browser/components/storybook/custom-elements-manifest.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
function removePrivateAndStaticFields() {
1111
return {
1212
packageLinkPhase({ customElementsManifest }) {
13-
customElementsManifest?.modules?.forEach(module => {
14-
module?.declarations?.forEach(declaration => {
13+
customElementsManifest?.modules?.forEach(m => {
14+
m?.declarations?.forEach(declaration => {
1515
if (declaration.members != null) {
1616
declaration.members = declaration.members.filter(member => {
1717
return (

devtools/client/debugger/babel.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
"use strict";
66

7-
/* global __dirname */
8-
97
/**
108
* NOTE: This file does not apply to builds in MC. This config is used for
119
* our Jest tests and for webpack bundle builds.

devtools/client/debugger/jest-test.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
"use strict";
66

7-
/* global __dirname */
8-
97
const sharedJestConfig = require(`${__dirname}/../shared/test-helpers/shared-jest.config`);
108

119
module.exports = {

devtools/client/debugger/jest.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
"use strict";
66

7-
/* global __dirname */
8-
97
const { resolve } = require("path");
108
const rootDir = resolve(__dirname);
119
module.exports = {

devtools/client/shared/sourceeditor/webpack.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
"use strict";
66

7-
/* global __dirname */
87
const path = require("path");
98

109
module.exports = (env, argv) => {

devtools/client/shared/test-helpers/shared-jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
"use strict";
66

7-
/* global __dirname */
87
const fixturesDir = `${__dirname}/jest-fixtures`;
98

109
module.exports = {

0 commit comments

Comments
 (0)