Bug 1789249 - ESLint should ignore files listed in Generated.txt, and ESLint linter tests. r=mossop

Differential Revision: https://phabricator.services.mozilla.com/D156457
This commit is contained in:
Mark Banner 2022-09-06 12:45:30 +00:00
parent 572b2bd7ba
commit 84e57ea707
2 changed files with 24 additions and 21 deletions

View file

@ -218,6 +218,9 @@ toolkit/components/translation/cld2/
toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js
toolkit/modules/AppConstants.jsm
# Tests of ESLint command.
tools/lint/test/files
# Uses special template formatting.
tools/tryselect/selectors/chooser/templates/chooser.html

View file

@ -22,15 +22,19 @@ function removeOverrides(config) {
return config;
}
function readFile(path) {
return fs
.readFileSync(path, { encoding: "utf-8" })
.split("\n")
.filter(p => p && !p.startsWith("#"));
}
const ignorePatterns = [
...fs
.readFileSync(
...readFile(
path.join(__dirname, "tools", "rewriting", "ThirdPartyPaths.txt")
)
.toString("utf-8")
.split("\n"),
...fs
.readFileSync(
),
...readFile(path.join(__dirname, "tools", "rewriting", "Generated.txt")),
...readFile(
path.join(
__dirname,
"devtools",
@ -39,11 +43,7 @@ const ignorePatterns = [
"src",
".eslintignore"
)
)
.toString("utf-8")
.split("\n")
.filter(p => p && !p.startsWith("#"))
.map(p => `devtools/client/debugger/src/${p}`),
).map(p => `devtools/client/debugger/src/${p}`),
];
module.exports = {