Fix lint errors 2/2

Reviewed By: jeanlauliac

Differential Revision: D4628330

fbshipit-source-id: 94fad1294e22fa0073e15843f94241ae778112a0
This commit is contained in:
Christoph Pojer
2017-03-01 08:15:51 -08:00
committed by Facebook Github Bot
parent 04f42ab075
commit 4d00df41b4
23 changed files with 176 additions and 179 deletions
@@ -25,7 +25,9 @@ module.exports = class HasteFS {
}
closest(path: string, fileName: string): ?string {
let {dir, root} = parse(path);
const parsedPath = parse(path);
const root = parsedPath.root;
let dir = parsedPath.dir;
do {
const candidate = join(dir, fileName);
if (this.files.has(candidate)) {
@@ -63,7 +65,9 @@ module.exports = class HasteFS {
function buildDirectorySet(files) {
const directories = new Set();
files.forEach(path => {
let {dir, root} = parse(path);
const parsedPath = parse(path);
const root = parsedPath.root;
let dir = parsedPath.dir;
while (dir !== '.' && dir !== root && !directories.has(dir)) {
directories.add(dir);
dir = dirname(dir);