Skip to content

typescript-eslint's "no any" rules don't work with inferred function types from sveltekitΒ #413

Open
@DetachHead

Description

@DetachHead

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

8.33.0

What version of eslint-plugin-svelte are you using?

2.22.0

What did you do?

Configuration
{
    "rules": {
        "@typescript-eslint/no-unsafe-member-access": "error"
    }
}
// routes/api/+server.ts
export const GET = async ({ request }) => {
    // request is not any, since it's inferred as Request by sveltekit
    request.headers // error: @typescript-eslint/no-unsafe-member-access
}

What did you expect to happen?

no error

What actually happened?

@typescript-eslint/no-unsafe-member-access error

Link to GitHub Repo with Minimal Reproducible Example

DetachHead/eslint-plugin-svelte-repros@7bf800d

Additional comments

originally raised at #390 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions