-
Notifications
You must be signed in to change notification settings - Fork 837
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade Typescript to 4.5.3 to match Kibana (#5591)
* Upgrade typescript to 4.5.3 - to match Kibana * Fix typescript err TS2339 Property 'MSInputMethodContext' does not exist on type 'Window & typeof globalThis' * Fix typescript error TS2783 Error: 'onClick' is specified more than once, so this usage will be overwritten. * Fix typescript errors TS2525 and TS7031 Errors: - Initializer provides no value for this binding element and the binding element has no default value. - Binding element '_onClick' implicitly has an 'any' type. Fixes: - Fix primary type issue, which was using `...` instead of `|| {}` - Remove unnecessary `_onClick` cast - Optional switch to optional chaining instead of && check * Fix typescript error TS2774 Error: - This condition will always return true since this function is always defined. Did you mean to call it instead? Fix: - [EuiPinnableListGroup] Remove unnecessary check, pinnable serves that purpose - [EuiOverlayMask] Remove unnecessary check, there's already an early return at the beginning of the block - [extra] DRY out portalTarget var - it's being used interchangably with overlayMaskNode.current * Fix catch error types (TS2571 & TS2345) Errors: - Object is of type 'unknown'. - Type 'unknown' is not assignable to type 'EuiMarkdownParseError | null' see https://stackoverflow.com/questions/68240884/error-object-inside-catch-is-of-type-unkown We could optionally disable `useUnknownInCatchVariables`, but I think it also does make sense to check for a valid Error instance if we're going to dive into it. * Update typescript related dependencies * Changelog * Update reactElementTypeExpanded replacement - it appears to have changed as of the recent upgrade, this keeps all props that output `ReactElement` the same as before * Expand string enums that are used within unions - Was previously working, with, e.g. `number | SomeStringEnum`, now needs a config to restore functionality * Revert shouldExtractValuesFromUnion - it's causing too many other unintended side effects (like turning `|`s into `,`s. There's probably no working around `number | SomeStringEnum` without stating the enum, it'll have to be a props doc changing going forward * Table auto props docs - spell out direction explicitly - enum no longer appears to be extracted by react-docgen * Fix other reactNodeTypeExpanded replace - appears to have also changed/shortened since the upgrade * Convert reactNodeTypeExpanded to a regex It appears as ``` string | number | boolean | {} | ReactElement | ReactNodeArray | ReactPortal ``` in some places, and ``` string | number | boolean | {} | ReactElement | ReactNodeArray | ReactPortal | ({} & string) | (ReactElement<...> & string) | (ReactNodeArray & string) | (ReactPortal & string) ``` in others - this regex should capture both scenarios * Portal auto props docs - spell out position explicitly - string enums within objects no longer appear to be expanded * Fix broken EuiButton props table - EuiButtonDisplay was bogarting the docgenInfo for the file, apparently - moving its declaration below EuiButton and giving EuiButton its a displayName seems to be required to get its docgenInfo working * Improve react-docgen-typescript wiki docs - Add warning about displayName bug found in dede73b#r799165839 - useful links to our custom react-docgen config/filters + react's docs - lint misc typos/grammar
- Loading branch information
Constance
authored
Feb 7, 2022
1 parent
27681eb
commit aa4cfd7
Showing
17 changed files
with
353 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.