chore: add import/newline-after-import lint rule

This commit is contained in:
Fredrik Adelöw
2020-07-02 11:05:59 +02:00
parent da6dbc7af0
commit 7389f326d9
32 changed files with 35 additions and 3 deletions
+1
View File
@@ -15,4 +15,5 @@
*/
import '@testing-library/jest-dom';
require('jest-fetch-mock').enableMocks();
+3 -2
View File
@@ -15,6 +15,7 @@
*/
import { useLocation } from 'react-router-dom';
import { Website, Audit, LighthouseCategoryId, AuditCompleted } from './api';
export function useQuery(): URLSearchParams {
return new URLSearchParams(useLocation().search);
}
@@ -53,13 +54,13 @@ export function buildSparklinesDataForItem(
(audit: Audit): audit is AuditCompleted => audit.status === 'COMPLETED',
)
.reduce((scores, audit) => {
Object.values(audit.categories).forEach((category) => {
Object.values(audit.categories).forEach(category => {
scores[category.id] = scores[category.id] || [];
scores[category.id].unshift(category.score);
});
// edge case: if only one audit exists, force a "flat" sparkline
Object.values(scores).forEach((arr) => {
Object.values(scores).forEach(arr => {
if (arr.length === 1) arr.push(arr[0]);
});