chore: enforce consistent spacing around object curlys (#5700)

The codebase was incredibly inconsistent with the use of spacing around
curly braces, e.g.:

```
// this?
const a = {b: 1}
// or?
const a = { b: 1 }
```

This extended into import statements also. Google's styleguide is no
spacing, so we're going with that.
This commit is contained in:
Jack Franklin
2020-04-21 10:40:04 +01:00
committed by GitHub
parent 3600f2f99b
commit e3922ea1f3
55 changed files with 791 additions and 789 deletions

View File

@@ -38,7 +38,7 @@ const GoldenComparators = {
*/
function compareImages(actualBuffer, expectedBuffer, mimeType) {
if (!actualBuffer || !(actualBuffer instanceof Buffer))
return { errorMessage: 'Actual result should be Buffer.' };
return {errorMessage: 'Actual result should be Buffer.'};
const actual = mimeType === 'image/png' ? PNG.sync.read(actualBuffer) : jpeg.decode(actualBuffer);
const expected = mimeType === 'image/png' ? PNG.sync.read(expectedBuffer) : jpeg.decode(expectedBuffer);
@@ -49,7 +49,7 @@ function compareImages(actualBuffer, expectedBuffer, mimeType) {
}
const diff = new PNG({width: expected.width, height: expected.height});
const count = pixelmatch(expected.data, actual.data, diff.data, expected.width, expected.height, {threshold: 0.1});
return count > 0 ? { diff: PNG.sync.write(diff) } : null;
return count > 0 ? {diff: PNG.sync.write(diff)} : null;
}
/**
@@ -59,7 +59,7 @@ function compareImages(actualBuffer, expectedBuffer, mimeType) {
*/
function compareText(actual, expectedBuffer) {
if (typeof actual !== 'string')
return { errorMessage: 'Actual result should be string' };
return {errorMessage: 'Actual result should be string'};
const expected = expectedBuffer.toString('utf-8');
if (expected === actual)
return null;
@@ -107,7 +107,7 @@ function compare(goldenPath, outputPath, actual, goldenName) {
}
const result = comparator(actual, expected, mimeType);
if (!result)
return { pass: true };
return {pass: true};
ensureOutputDir();
if (goldenPath === outputPath) {
fs.writeFileSync(addSuffix(actualPath, '-actual'), actual);