Use Prettier JS (#5017)

* Adds prettier

* Run lint before tests
This commit is contained in:
Florent Vilmart
2018-09-01 13:58:06 -04:00
committed by GitHub
parent 189cd259ee
commit d83a0b6808
240 changed files with 41098 additions and 29020 deletions

View File

@@ -5,7 +5,7 @@ function numberParser(key) {
throw new Error(`Key ${key} has invalid value ${opt}`);
}
return intOpt;
}
};
}
function numberOrBoolParser(key) {
@@ -20,14 +20,14 @@ function numberOrBoolParser(key) {
return false;
}
return numberParser(key)(opt);
}
};
}
function objectParser(opt) {
if (typeof opt == 'object') {
return opt;
}
return JSON.parse(opt)
return JSON.parse(opt);
}
function arrayParser(opt) {
@@ -41,12 +41,14 @@ function arrayParser(opt) {
}
function moduleOrObjectParser(opt) {
if (typeof opt == 'object') {
if (typeof opt == 'object') {
return opt;
}
try {
return JSON.parse(opt);
} catch(e) { /* */ }
} catch (e) {
/* */
}
return opt;
}
@@ -71,5 +73,5 @@ module.exports = {
booleanParser,
moduleOrObjectParser,
arrayParser,
objectParser
objectParser,
};