You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tracking issue for updates needed for the upcoming TypeScript 3.1, which will no longer automatically add [x: string]: any; to any type inferred from an object declaration. This is only a change for js; this was never done in ts.
It was helpful in cases where we were mapping specific small objects to a general grab-bag type (e.g. {type: 'code', snippet: str} and then saying it was of a more general details item type), and we'll have to explicitly declare a few more types to fix those places.
But it means certain errors will now be caught. e.g. in TS≤3.0 in lighthouse-ext-background.js, if you refer to background.getDefaultCategories() the return value will be type checked, but if you do background.getCategoriez() the compiler will think the call is valid and returns an any, because the compiler was automatically adding a [x: string]: any; to the lighthouse-background.js export.
Before I started we had almost 100 errors from this, and fixing them only makes things more correct (even in 3.0), so I thought I'd start early. In many places a single line fix and multiple errors are resolved, so it shouldn't be too bad.
tracking issue for updates needed for the upcoming TypeScript 3.1, which will no longer automatically add
[x: string]: any;
to any type inferred from an object declaration. This is only a change for js; this was never done in ts.It was helpful in cases where we were mapping specific small objects to a general grab-bag type (e.g.
{type: 'code', snippet: str}
and then saying it was of a more general details item type), and we'll have to explicitly declare a few more types to fix those places.But it means certain errors will now be caught. e.g. in TS≤3.0 in
lighthouse-ext-background.js
, if you refer tobackground.getDefaultCategories()
the return value will be type checked, but if you dobackground.getCategoriez()
the compiler will think the call is valid and returns anany
, because the compiler was automatically adding a[x: string]: any;
to thelighthouse-background.js
export.Before I started we had almost 100 errors from this, and fixing them only makes things more correct (even in 3.0), so I thought I'd start early. In many places a single line fix and multiple errors are resolved, so it shouldn't be too bad.
core(tsc): type check config files #5858core(tsc): add explicit index signature in mainthread-work-breakdown #5859core(tsc): remove more reliance on implicit index signatures #5874core(tsc): tighten traceOfTab timing types #5887core(tsc): don't use index signature in LHErrors #5896load-simulator
/simulator.js
core(tsc): don't rely on index signatures in load-simulator/simulator.js #5897core(tsc): update to ts 3.1 for new protocol defs #5942DetailsItem
The text was updated successfully, but these errors were encountered: