-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
report: isolate flow-report type checking #12952
Conversation
|
||
const flowResult = JSON.parse( | ||
fs.readFileSync( | ||
`${LH_ROOT}/lighthouse-core/test/fixtures/fraggle-rock/reports/sample-lhrs.json`, | ||
`${__dirname}/../../lighthouse-core/test/fixtures/fraggle-rock/reports/sample-lhrs.json`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar to #12940 (comment), root.js
isn't accessible without importing all of core, so this works for now.
I also don't have a good mental model for where tsx
files live on the commonjs <-> esmodules spectrum and what works in them and what doesn't. Does it just depend on the bundler?
@@ -1,14 +1,37 @@ | |||
{ | |||
"extends": "../tsconfig", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll switch this back to extending and move most of this back to a tsconfig-base.json
or whatever in a follow up
flow-report/App.tsx
Outdated
@@ -6,8 +6,10 @@ | |||
|
|||
import {FunctionComponent} from 'preact'; | |||
import {useState} from 'preact/hooks'; | |||
import type FlowResult from '../types/lhr/flow'; | |||
import type LHResult from '../types/lhr/lhr'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
went with explicit type import because this is tsx. Could add declare LH {}
to flow-report.d.ts
instead if global types are preferred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Global types SGTM, I think it would also prevent a merge conflict with #12929
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Global types SGTM
done
flow-report/App.tsx
Outdated
@@ -6,8 +6,10 @@ | |||
|
|||
import {FunctionComponent} from 'preact'; | |||
import {useState} from 'preact/hooks'; | |||
import type FlowResult from '../types/lhr/flow'; | |||
import type LHResult from '../types/lhr/lhr'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Global types SGTM, I think it would also prevent a merge conflict with #12929
fairly straightforward, though a few options here to change now or later, depending on your preferences, @adamraine