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

Depends and invalidate without a colon should be a type error #9763

Closed
nathancahill opened this issue Apr 22, 2023 · 1 comment
Closed

Depends and invalidate without a colon should be a type error #9763

nathancahill opened this issue Apr 22, 2023 · 1 comment

Comments

@nathancahill
Copy link

Description

depends() and invalidate() require the URI to have a colon : otherwise they will be subtly broken.

Proposed solution

svelte-check should flag when these strings do not have a colon.

Alternatives

No response

Additional Information, eg. Screenshots

No response

@jasonlyu123
Copy link
Member

If we are ever going to check this, this should be done in the kit's type definition using a template literal type. But that will be a breaking change. And it might be somewhat annoying since you can't pass in a variable typed as string. As an alternative, maybe it's more suitable as an eslint rule where it's more opted-in.

@dummdidumm dummdidumm transferred this issue from sveltejs/language-tools Apr 25, 2023
@dummdidumm dummdidumm added this to the 2.0 milestone Apr 25, 2023
@dummdidumm dummdidumm changed the title Svelte check should detect depends and invalidate without a colon Depends and invalidate without a colon should be a type error Apr 25, 2023
dummdidumm added a commit that referenced this issue Dec 5, 2023
require a `:` when passing a string now
closes #9763
dummdidumm added a commit that referenced this issue Dec 7, 2023
require a `:` when passing a string now
closes #9763
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants