Skip to content
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

Feature request: support typecheck in rule: valid-expect #524

Open
levchak0910 opened this issue Sep 3, 2024 · 0 comments
Open

Feature request: support typecheck in rule: valid-expect #524

levchak0910 opened this issue Sep 3, 2024 · 0 comments

Comments

@levchak0910
Copy link

Hi, thanks for such a great plugin, it helps a lot )

Based on tests seems like the rule valid-expect doesn't (or not entirely) supports typecheck

import { describe, expectTypeOf, test } from "vitest"

describe("valid-expect", () => {
  test("cases", async () => {
    const fn = (arg: string): number => Number(arg)

    expectTypeOf(fn).toBeFunction() // OK
    expectTypeOf(fn).parameter(0).toMatchTypeOf<string>() // OK
    expectTypeOf(fn).returns.toMatchTypeOf<number>() // Fail: Expect has unknown modifier eslint test/valid-expect
  })
})

Do you have any plans to fix or add support for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant