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

fix(core): eslint migration caused wrong CustomScope type #13013

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

HuiSF
Copy link
Contributor

@HuiSF HuiSF commented Feb 14, 2024

Description of changes

The CustomScope should be a string type CustomScope = string & {} was used to ensure OAuthScope won't resolve as a string.

The eslint migration required change of using {}, and the change was wrong.

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 February 14, 2024 19:44
@HuiSF HuiSF marked this pull request as draft February 14, 2024 19:45
@HuiSF HuiSF marked this pull request as ready for review February 14, 2024 19:54
Copy link
Contributor

@ashika112 ashika112 left a comment

Choose a reason for hiding this comment

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

Good Catch.

type CustomScope = string & Record<string, string>;
// CustomScope is a non-nullish string, using `& NonNullable<unknown>` to ensure
// `OAuthScope` is not resolved as a `string`
type CustomScope = string & NonNullable<unknown>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughts on a util type? It seems like we'll run into this at least a couple more times with the Auth category.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, will add and refactor when migrate the auth package accordingly.

@HuiSF HuiSF merged commit 3d2803e into main Feb 14, 2024
31 checks passed
@HuiSF HuiSF deleted the hui/fix/core/wrong-custom-scope-type branch February 14, 2024 20:32
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.

None yet

4 participants