Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
DetachHead opened this issue Dec 16, 2022 · 2 comments
Closed

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

DetachHead opened this issue Dec 16, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@DetachHead
Copy link
Contributor

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

@DetachHead DetachHead added the bug Something isn't working label Dec 16, 2022
@dummdidumm
Copy link
Member

typescript-eslint is not under our control and unrelated to this repository, therefore closing

@dummdidumm dummdidumm closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2022
@DetachHead
Copy link
Contributor Author

But $$Generic is part of svelte, so I doubt the typescript-eslint maintainers would care either.

Hopefully when #1778 is fixed it will fix this issue as well

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants