Skip to content

$$Generics are treated as any by typescript-eslint #1780

@DetachHead

Description

@DetachHead

Describe the bug

the typescript-eslint plugin seems to not be aware of $$Generic, and treats them as any.

Reproduction

  1. enable @typescript-eslint/no-unsafe-member-access and @typescript-eslint/no-unsafe-call in your eslint config
  2. create a .svelte file with the following contents:
    <script lang="ts">
        type T = $$Generic<number>
    
        export let foo: T
    
        // Unsafe member access .toString on an `any` value. (@typescript-eslint/no-unsafe-member-access)
        // Unsafe call of an `any` typed value. (@typescript-eslint/no-unsafe-call)
        foo.toString()
    </script>

Expected behaviour

no errors as T extends number so it cannot be any

System Info

  • OS: windows 10
  • IDE: vscode

Which package is the issue about?

svelte-language-server

Additional Information, eg. Screenshots

probably related to #1778, i assume typescript is just treating it as any in both cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions