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(pubsub): enable eslint and remove tslint #13081

Merged
merged 3 commits into from
Mar 6, 2024
Merged

Conversation

HuiSF
Copy link
Member

@HuiSF HuiSF commented Mar 4, 2024

Description of changes

Change details see each commit of this PR.

Issue #, if available

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@HuiSF HuiSF requested review from a team as code owners March 4, 2024 23:02
@@ -52,7 +53,7 @@ export enum ConnectionState {
ConnectedPendingKeepAlive = 'ConnectedPendingKeepAlive',
}

export type PubSubContent = Record<string, unknown>;
export type PubSubContent = Record<string | symbol, unknown>;
Copy link
Member

Choose a reason for hiding this comment

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

curious: how is this coming up only now? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

In the api-graphql package (if I remembered correctly), it trying to assign an object that uses symbol as key to this type. Which causes incompatible key signature error, so expanding the key to union symbol here

}): void;
onConnectionLost(params: { errorCode: number }): void;
connect(
params: Record<string, string | number | boolean | (() => void)>,
Copy link
Member

Choose a reason for hiding this comment

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

Why prefer record over the current implementation?

Copy link
Member Author

Choose a reason for hiding this comment

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

The original implementation is a Record with string as the key. Record is more readable and recommended I presume so it has been auto fixed.

@HuiSF HuiSF force-pushed the hui/chore/pubsub/eslint branch from 678690c to 86323c4 Compare March 5, 2024 23:59
@HuiSF HuiSF merged commit 14c51e1 into main Mar 6, 2024
30 checks passed
@HuiSF HuiSF deleted the hui/chore/pubsub/eslint branch March 6, 2024 19:35
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