author | Mike Cooper <mcooper@mozilla.com> |
Tue, 25 Apr 2017 14:12:31 -0700 | |
changeset 354842 | c1db498519cd435b1d4af51ed6147bd13846d0fe |
parent 354841 | 73b97e528623649a616ac9d9692ebac532638ece |
child 354843 | 939575bd231f9af1614bf12dd773b8b58585040c |
push id | 41486 |
push user | mcooper@mozilla.com |
push date | Tue, 25 Apr 2017 22:48:07 +0000 |
treeherder | autoland@c1db498519cd [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mossop |
bugs | 1358310 |
milestone | 55.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/helpers.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/helpers.js @@ -521,22 +521,26 @@ module.exports = { * Gets the root directory of the repository by walking up directories from * this file until a .eslintignore file is found. * @return {String} The absolute path of the repository directory */ get rootDir() { if (!gRootDir) { let dirName = path.dirname(module.filename); - while (dirName && !fs.existsSync(path.join(dirName, ".eslintignore"))) { - dirName = path.dirname(dirName); - } - - if (!dirName) { - throw new Error("Unable to find root of repository"); + while (true) { + const parsed = path.parse(dirName); + if (parsed.root === dirName) { + // We've reached the top of the filesystem + throw new Error("Unable to find root of repository"); + } + dirName = parsed.dir; + if (fs.existsSync(path.join(dirName, ".eslintignore"))) { + break; + } } gRootDir = dirName; } return gRootDir; },
--- a/tools/lint/eslint/eslint-plugin-mozilla/package.json +++ b/tools/lint/eslint/eslint-plugin-mozilla/package.json @@ -1,11 +1,11 @@ { "name": "eslint-plugin-mozilla", - "version": "0.2.45", + "version": "0.2.46", "description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.", "keywords": [ "eslint", "eslintplugin", "eslint-plugin", "mozilla", "firefox" ],