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

[job-components, scripts, terafoundation, teraslice-cli, teraslice-client-js, teraslice-messaging, utils, xlucene-parser] fix implicit any index typescript errors #3789

Merged
merged 15 commits into from
Oct 17, 2024

Conversation

busma13
Copy link
Contributor

@busma13 busma13 commented Oct 7, 2024

In typescript 5.5 the suppressImplicitAnyIndexErrors rule will be removed. This PR fixes all ignored errors of this type in the following packages in preparation for the move to version 5.5 or above:

  • job-components
  • scripts
  • terafoundation
  • teraslice-cli
  • teraslice-client-js
  • teraslice-messaging
  • utils
  • xlucene-parser

suppressImplicitAnyIndexErrors is set to true in the tsconfig of all updated packages so we don't introduce any more of these errors before the rule is removed at the root level.

Todo: bump packages

Packages that still have these errors:

  • data-mate - 1
  • elasticsearch-store - 22
  • teraslice - 124
  • teraslice-state-storage - 13
  • ts-transforms - 20

ref: #3772

@busma13 busma13 marked this pull request as ready for review October 7, 2024 22:33
@busma13 busma13 requested a review from jsnoble October 7, 2024 22:33
packages/utils/src/geo.ts Outdated Show resolved Hide resolved
Copy link
Member

@jsnoble jsnoble left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +36 to +42
/**
* Verify that k is a key of object O
*/
export function isKey<T extends object>(O: T, k: PropertyKey): k is keyof T {
return k in O;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the getKeys function used in earlier commits in favor of isKey. getKeys used type assertion, so could be unsafe. isKey just returns a boolean and narrows the type for us.

@godber godber merged commit 09febc5 into master Oct 17, 2024
66 checks passed
@godber godber deleted the update-typescript branch October 17, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants