Skip to content

Add types for fetchpriority on link and script elements #10394

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

Closed
oscarhermoso opened this issue Feb 5, 2024 · 1 comment
Closed

Add types for fetchpriority on link and script elements #10394

oscarhermoso opened this issue Feb 5, 2024 · 1 comment

Comments

@oscarhermoso
Copy link

Describe the problem

Encountering red squiggles on fetchpriority, even though it's a valid attribute

It's annoying in this context because there's no way to suppress the error without applying // @ts-nocheck to the whole file (please correct me if I'm wrong)

<svelte:head>
    <script
        src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit"
        async
        on:load={() => {
            script_loaded = true;
        }}
        fetchpriority="low"></script>
<!--    ^^^^^^^^^^^^^^ 
        Object literal may only specify known properties, and '"fetchpriority"' does not 
        exist in type 'HTMLProps<"script", HTMLAttributes<any>>'.js(2353) -->
</svelte:head>

Screenshot from 2024-02-05 08-32-28

Describe the proposed solution

Add type support for the fetchpriority attribute on HTMLScriptElement. May as well add it for HTMLLinkElement while we are in the space too.

(Support for HTMLImageElement was already added here)

Browser support is solid, except for FireFox 🙂

Importance

nice to have

@dummdidumm
Copy link
Member

fixes by #10390

dummdidumm added a commit that referenced this issue Feb 5, 2024
Works on more elements besides img
fixes #10394
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

2 participants