Skip to content

Svelte 4 Generic Syntax in docs #245

Closed
@Skylli202

Description

@Skylli202

Hi,

I experimented the guide about componentization, once I made my way through (very helpful guide btw, thanks a lot). I had an issue with ESLint. ESlint was not happy about this : type T = $$Generic<AnyZodObject>;, in the TextField.svelte component.

After doing some research, I think (I'm not a Svelte pro yet!) that this is the old way of defining generics. The new version would be within the script tag <script lang="ts" generics="T extends AnyZodObject">. But my ESLint is not happier by this way of defining the generic.

I would be happy to make a PR to edit the documentation, but I'd like to have my take validated first.

Thanks in advance.


GitHub issues related to this syntax issues :
sveltejs/eslint-plugin-svelte3#127
sveltejs/svelte-eslint-parser#306
sveltejs/eslint-plugin-svelte#521 <-- much recent and interesting

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions