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

chore(ts): avoid more ts-ignores #4817

Merged
merged 1 commit into from
Jul 30, 2021
Merged

chore(ts): avoid more ts-ignores #4817

merged 1 commit into from
Jul 30, 2021

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Jul 30, 2021

ts-expect-error will error if it's no longer needed, so it's better in almost all cases. There's some moments where we need to keep ts-ignore though:

  • things that fail only with algoliasearch v3 or v4
  • optional packages (places)
  • code that doesn't always error

At the same time updated the algoliasearch-helper to a version that includes showParentLevel in the typings

part of DX-2299

ts-expect-error will error if it's no longer needed, so it's better in almost all cases. There's some moments where we need to keep ts-ignore though:
- things that fail only with algoliasearch v3 or v4
- optional packages (places)
- code that doesn't always error

At the same time updated the algoliasearch-helper to a version that includes `showParentLevel` in the typings
@Haroenv Haroenv requested review from a team, tkrugg and shortcuts and removed request for a team July 30, 2021 10:04
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 934999b:

Sandbox Source
InstantSearch.js Configuration

@@ -47,18 +48,20 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/answers/js/
indexName: 'instant_search',
searchClient,
});
search.helper = helper;
Copy link
Member

Choose a reason for hiding this comment

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

Why did we have to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

createInitOptions gets the state from the InstantSearch instance (before it was undefined), in theory we could also have grabbed it from the helper argument, but that isn't such a big difference (usually they will be the same)

@Haroenv Haroenv merged commit 21b6c53 into master Jul 30, 2021
@Haroenv Haroenv deleted the chore/ts-ignore branch July 30, 2021 11:27
@shortcuts
Copy link
Member

That's a satisfying PR

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