From de7ea481cd4eb1d0f355d858ced907a6656bb6e6 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Fri, 7 Feb 2025 15:56:51 +0100 Subject: [PATCH] fix lint --- packages/html-reporter/src/icons.tsx | 2 +- packages/html-reporter/src/metadataView.tsx | 6 +++--- packages/html-reporter/src/reportView.tsx | 2 +- packages/html-reporter/src/testErrorView.tsx | 12 ++++++------ packages/html-reporter/src/testFilesView.tsx | 2 +- packages/html-reporter/src/testResultView.tsx | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/html-reporter/src/icons.tsx b/packages/html-reporter/src/icons.tsx index f876748fe5..df40c82f00 100644 --- a/packages/html-reporter/src/icons.tsx +++ b/packages/html-reporter/src/icons.tsx @@ -100,6 +100,6 @@ export const copy = () => { export const copilot = () => { return ; }; diff --git a/packages/html-reporter/src/metadataView.tsx b/packages/html-reporter/src/metadataView.tsx index 0cdf38b6c5..e9c6bef64b 100644 --- a/packages/html-reporter/src/metadataView.tsx +++ b/packages/html-reporter/src/metadataView.tsx @@ -28,11 +28,11 @@ type MetadataEntries = [string, unknown][]; export const MetadataContext = React.createContext([]); -export function MetadataProvider({ metadata}: React.PropsWithChildren<{ metadata: Metadata }>) { +export function MetadataProvider({ metadata }: React.PropsWithChildren<{ metadata: Metadata }>) { const entries = React.useMemo(() => { // TODO: do not plumb actualWorkers through metadata. - - return Object.entries(metadata).filter(([key]) => key !== 'actualWorkers') + + return Object.entries(metadata).filter(([key]) => key !== 'actualWorkers'); }, [metadata]); return ; diff --git a/packages/html-reporter/src/reportView.tsx b/packages/html-reporter/src/reportView.tsx index abb197abc3..baf85f32a8 100644 --- a/packages/html-reporter/src/reportView.tsx +++ b/packages/html-reporter/src/reportView.tsx @@ -14,7 +14,7 @@ limitations under the License. */ -import type { FilteredStats, HTMLReport, TestCase, TestCaseSummary, TestFile, TestFileSummary } from './types'; +import type { FilteredStats, TestCase, TestCaseSummary, TestFile, TestFileSummary } from './types'; import * as React from 'react'; import './colors.css'; import './common.css'; diff --git a/packages/html-reporter/src/testErrorView.tsx b/packages/html-reporter/src/testErrorView.tsx index d7aab5211c..d21daa85dc 100644 --- a/packages/html-reporter/src/testErrorView.tsx +++ b/packages/html-reporter/src/testErrorView.tsx @@ -20,7 +20,7 @@ import './testErrorView.css'; import * as icons from './icons'; import type { ImageDiff } from '@web/shared/imageDiffView'; import { ImageDiffView } from '@web/shared/imageDiffView'; -import { TestResult } from './types'; +import type { TestResult } from './types'; import { CopyToClipboard } from './copyToClipboard'; import { fixTestPrompt } from '@web/components/prompts'; import { useGitCommitInfo } from './metadataView'; @@ -51,12 +51,12 @@ const PromptButton: React.FC<{ }> = ({ error, result }) => { const gitCommitInfo = useGitCommitInfo(); const prompt = React.useMemo(() => fixTestPrompt( - error, - gitCommitInfo?.['pull.diff'] ?? gitCommitInfo?.['revision.diff'], - result?.attachments.find(a => a.name === 'pageSnapshot')?.body - ), [gitCommitInfo, result, error]) + error, + gitCommitInfo?.['pull.diff'] ?? gitCommitInfo?.['revision.diff'], + result?.attachments.find(a => a.name === 'pageSnapshot')?.body + ), [gitCommitInfo, result, error]); - return } title="Copy prompt to clipboard" />; + return } title='Copy prompt to clipboard' />; }; export const TestScreenshotErrorView: React.FC<{ diff --git a/packages/html-reporter/src/testFilesView.tsx b/packages/html-reporter/src/testFilesView.tsx index 809e3b0748..dcac5e8cea 100644 --- a/packages/html-reporter/src/testFilesView.tsx +++ b/packages/html-reporter/src/testFilesView.tsx @@ -67,9 +67,9 @@ export const TestFilesHeader: React.FC<{ metadataVisible: boolean, toggleMetadataVisible: () => void, }> = ({ report, filteredStats, metadataVisible, toggleMetadataVisible }) => { + const metadataEntries = useMetadata(); if (!report) return; - const metadataEntries = useMetadata(); return <>
{metadataEntries.length > 0 &&
diff --git a/packages/html-reporter/src/testResultView.tsx b/packages/html-reporter/src/testResultView.tsx index 41054a9a41..3243b2bcb9 100644 --- a/packages/html-reporter/src/testResultView.tsx +++ b/packages/html-reporter/src/testResultView.tsx @@ -24,7 +24,7 @@ import { Anchor, AttachmentLink, generateTraceUrl, testResultHref } from './link import { statusIcon } from './statusIcon'; import type { ImageDiff } from '@web/shared/imageDiffView'; import { ImageDiffView } from '@web/shared/imageDiffView'; -import { CodeSnippet, PromptButton, TestErrorView, TestScreenshotErrorView } from './testErrorView'; +import { CodeSnippet, TestErrorView, TestScreenshotErrorView } from './testErrorView'; import * as icons from './icons'; import './testResultView.css';