Conversation
|
|
||
| public switchViewMode = () => { | ||
| this.setState((prevState: State) => { | ||
| this.setState<'viewMode'>((prevState: State) => { |
There was a problem hiding this comment.
ℹ️ It complains that { viewMode } is missing loading, because I think it cannot automatically infer the generic type here, due to the if (it actually infers it to never).
| map(url => url.hostname), | ||
| mapNullable(hostname => isWhitelisted(config, hostname)), | ||
| getOrElse(() => false) | ||
| getOrElse<boolean>(() => false) |
There was a problem hiding this comment.
ℹ️ It infers the generic type false here, and then complains, that the mapNullable produces a boolean which is not assignable to false. I think the typings of pipe are just a bit weird, that they are "checking backwards" from the last function.
| } | ||
|
|
||
| export type AlertTypeRegistry = PublicMethodsOf<AlertTypeRegistry>; | ||
| export type AlertTypeRegistry = PublicMethodsOf<OrigAlertTypeRegistry>; |
There was a problem hiding this comment.
ℹ️ The usual 3.7 issue, that you cannot have an import and export with the same name (but different values) in one file anymore.
| message?: any; | ||
| rowProps?: any; | ||
| cellProps?: any; | ||
| responsive?: boolean; |
There was a problem hiding this comment.
ℹ️ This was just used somewhere, and I honestly have no idea how this didn't fail in the current TS .
| Object.keys(IndexGroup).forEach(typeKey => { | ||
| const consumerType = IndexGroup[typeKey as any] as IndexGroup; | ||
|
|
||
| Object.entries(IndexGroup).forEach(([typeKey, consumerType]) => { |
There was a problem hiding this comment.
ℹ️ The as any typing complained, that any is not a valid key to the IndexGroup enum. So I actually just used the entries method here, which a/ looks nicer and b/ is perfectly type safe now.
|
Jenkins, test this - CI failed to report |
💚 Build Succeeded |
|
@elasticmachine merge upstream |
💚 Build Succeeded |
|
Ignoring CODEOWNERS review since it only changing very minor typings in their files. |
Summary
This PR addresses a couple of TS issues, that will break once upgraded to TS 3.7.0. This PR mostly contains smaller changes not really effecting any specific plugin a lot, so I randomly select a couple of TS experts for review here.
For QA: This PR does not contain any functional changes.