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
fix: lint errors removed by using satisfies
or as
for type
#3934
Conversation
@@ -125,12 +134,12 @@ watch( | |||
if (props.show) { | |||
persistenceService.setLocalConfig( | |||
"unsaved_collection_properties", | |||
JSON.stringify(<EditingProperties>{ | |||
JSON.stringify({ |
There was a problem hiding this comment.
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.
720f46d
to
79d3e8a
Compare
There was a problem hiding this 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
5655288
to
ae7cdfa
Compare
Description
Using
satisfies
oras
for type enforcement to skip lint errors.