зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1358310
- eslint-plugin-mozilla: Fix infinite loop when finding repo root. r=mossop
MozReview-Commit-ID: KrOH7qtiLwS --HG-- extra : rebase_source : 7d3ec6e407c0096e45afc23e6e117533cb4b6522
This commit is contained in:
Родитель
ff655e4906
Коммит
2440f29f89
|
@ -526,12 +526,16 @@ module.exports = {
|
|||
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;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"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",
|
||||
|
|
Загрузка…
Ссылка в новой задаче