-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[SIEM] [Detection Engine] Remove unnecessary ts-ignores #58689
[SIEM] [Detection Engine] Remove unnecessary ts-ignores #58689
Conversation
Pinging @elastic/siem (Team:SIEM) |
… array items can result in undefined even though typescript says its not
@@ -222,8 +222,9 @@ export const getIndex = (getSpaceId: () => string, config: LegacyServices['confi | |||
return `${signalsIndex}-${spaceId}`; | |||
}; | |||
|
|||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |||
export const convertToSnakeCase = <T extends Record<string, any>>(obj: T): Partial<T> | null => { | |||
export const convertToSnakeCase = <T extends Record<string, unknown>>( |
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.
removed explicit any and replaced with unknown.
💚 Build SucceededTo update your PR or re-run it, just comment with: |
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.
LGTM!
* fixes from comments on previous PR * replaces any with unknown, adds test to show how optional chaining of array items can result in undefined even though typescript says its not
Summary
Remove ts-ignore lines from feedback here #58274 (review) and here #58274 (review)
Also replaces the any with unknown in the convertToSnakeCase function in order and provides a test case to show how an undefined can sneak past typescript (see microsoft/TypeScript#11122)
Checklist
Delete any items that are not applicable to this PR.
For maintainers