Skip to content

Commit

Permalink
Bug 1607172 - Update ESLint to the latest version and use ignorePatte…
Browse files Browse the repository at this point in the history
…rns to ignore paths listed in ThirdPartyPaths.txt. r=mossop

Differential Revision: https://phabricator.services.mozilla.com/D59691

--HG--
extra : moz-landing-system : lando
  • Loading branch information
Standard8 committed Jan 21, 2020
1 parent b9bec0d commit 9670910
Show file tree
Hide file tree
Showing 12 changed files with 640 additions and 551 deletions.
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Please DO NOT add more third party files to this file.
# They should be added to tools/rewriting/ThirdPartyPaths.txt instead.
# The remaining third-party paths will be removed in bug 1608799.

# This file should only be used for exclusions where we have:
# - preprocessed files
# - generated files that are for some reason checked into source
# - intentionally invalid files
# - build directories and other items that we need to ignore

# Always ignore node_modules.
**/node_modules/

Expand Down
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const xpcshellTestConfig = require("eslint-plugin-mozilla/lib/configs/xpcshell-t
const browserTestConfig = require("eslint-plugin-mozilla/lib/configs/browser-test.js");
const mochitestTestConfig = require("eslint-plugin-mozilla/lib/configs/mochitest-test.js");
const chromeTestConfig = require("eslint-plugin-mozilla/lib/configs/chrome-test.js");
const fs = require("fs");

/**
* Some configurations have overrides, which can't be specified within overrides,
Expand Down Expand Up @@ -32,7 +33,12 @@ const chromeTestPaths = [
"**/test*/chrome/",
];

const ignorePatterns =
fs.readFileSync("tools/rewriting/ThirdPartyPaths.txt")
.toString("utf-8").split("\n");

module.exports = {
ignorePatterns,
// 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.
Expand Down
2 changes: 2 additions & 0 deletions browser/components/places/content/places-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@

// Force an initial build.
if (this.place) {
// eslint-disable-next-line no-self-assign
this.place = this.place;
}
}
Expand Down Expand Up @@ -183,6 +184,7 @@
this.setAttribute("flatList", val);
// reload with the last place set
if (this.place) {
// eslint-disable-next-line no-self-assign
this.place = this.place;
}
}
Expand Down
Loading

0 comments on commit 9670910

Please sign in to comment.