Skip to content
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

Merged
merged 2 commits into from
Feb 27, 2020

Conversation

dhurley14
Copy link
Contributor

@dhurley14 dhurley14 commented Feb 27, 2020

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

@dhurley14 dhurley14 self-assigned this Feb 27, 2020
@dhurley14 dhurley14 added release_note:skip Skip the PR/issue when compiling release notes Team:SIEM v7.7.0 v8.0.0 labels Feb 27, 2020
@elasticmachine
Copy link
Contributor

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>>(
Copy link
Contributor Author

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.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@yctercero yctercero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dhurley14 dhurley14 merged commit a06cc31 into elastic:master Feb 27, 2020
@dhurley14 dhurley14 deleted the unit-test-pr-comment-fixes branch February 27, 2020 16:09
dhurley14 added a commit to dhurley14/kibana that referenced this pull request Feb 27, 2020
* 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
dhurley14 added a commit that referenced this pull request Feb 27, 2020
)

* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:SIEM v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants