refactor: make entire project typecheck with root tsconfig (#7466)

This commit is contained in:
Joshua Chen 2022-05-23 12:54:25 +08:00 committed by GitHub
parent 89b0fff128
commit 2d94d575a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 74 additions and 36 deletions

View file

@ -35,7 +35,9 @@ const scoreEntry = (rawScore) => {
const createMarkdownTableRow = ({url, summary, reportUrl}) =>
[
`| [${new URL(url).pathname}](${url})`,
...Object.keys(summaryKeys).map((k) => scoreEntry(summary[k])),
.../** @type {(keyof LighthouseSummary)[]} */ (
Object.keys(summaryKeys)
).map((k) => scoreEntry(summary[k])),
`[Report](${reportUrl}) |`,
].join(' | ');
@ -54,8 +56,10 @@ const createMarkdownTableHeader = () => [
const createLighthouseReport = ({results, links}) => {
const tableHeader = createMarkdownTableHeader();
const tableBody = results.map((result) => {
const testUrl = Object.keys(links).find((key) => key === result.url);
const reportPublicUrl = links[testUrl];
const testUrl = /** @type {string} */ (
Object.keys(links).find((key) => key === result.url)
);
const reportPublicUrl = /** @type {string} */ (links[testUrl]);
return createMarkdownTableRow({
url: testUrl,