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
Wrong no-unsafe-member-access for reactive assignments and store subscriptions #89
Comments
Sorry to bump this but this is pretty annoying as stores are quite a core feature of svelte. Is there any workaround except for adding ignore directives? |
This should be fixed for stores, for reactive statements it's not working yet. |
is this the same issue? <script lang="ts">
$: foo = 1
foo.toString // no error
const bar = () => {
foo.toString // @typescript-eslint/no-unsafe-member-access
}
</script> |
any updates on that? It's super annoying.. |
any update? |
The README of this project says it got replaced. Idk if that helps though |
Just noticed that :-/. I updated to |
#87 uncovered some limitations when using type-aware rules. Some of these are fixed by #88 , but not all of them. Reactive assignments and store subscriptions will fail:
This is because the transformation just prepends generated
let X
statements above the code, with no specific type set to it. For it to work correctly, we would need to do transformations inline:$: assignment = ..
-->let assignment = ..
(but only if user did not declare thelet
himself)const store = writable(...)
-->const store = writable(..);let $store = get_store_value(store)
(whereget_store_value
is a fake function returning theValue
inStore<Value>
)This would be similar to how we transform code in
svelte2tsx
for the intellisense features. The hard part is getting the line mappings correctly afterwards.The text was updated successfully, but these errors were encountered: