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: lint errors removed by using satisfies or as for type #3934

Merged

Conversation

anwarulislam
Copy link
Member

@anwarulislam anwarulislam commented Mar 25, 2024

Description

Using satisfies or as for type enforcement to skip lint errors.

Before After
image image
  • Not Completed
  • Completed

@@ -125,12 +134,12 @@ watch(
if (props.show) {
persistenceService.setLocalConfig(
"unsaved_collection_properties",
JSON.stringify(<EditingProperties>{
JSON.stringify({
Copy link
Contributor

Choose a reason for hiding this comment

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

both the angle-bracket syntax and using as to assert just tells typescript that we know what we're doing, and dont bother checking it. but in the future if someone passes an invalid object that does not adhear to the type, typescript won't catch that.

ideally in this case, we can extract the object into variable and assign a type for that, and tries to fix any errors that comes up.

Copy link
Contributor

@amk-dev amk-dev left a comment

Choose a reason for hiding this comment

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

the root cause of the errors with angle-bracket assertion (<>) was because parserOptions.ecmaFeatures.jsx was enabled.

this is the default behaviour in @vue/typescript/recommended package. since we don't use jsx, we can disable this option. added this change in 79d3e8a

@AndrewBastin AndrewBastin merged commit 1f7a8ed into hoppscotch:release/2024.3.0 Mar 28, 2024
1 check passed
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