eslint-plugin-vitest icon indicating copy to clipboard operation
eslint-plugin-vitest copied to clipboard

valid-title should allow functions

Open JoshuaKGoldberg opened this issue 2 years ago • 1 comments

As of https://github.com/vitest-dev/vitest/issues/3493 -> https://github.com/vitest-dev/vitest/pull/3497, Vitest describes & similar can take in function names. I think the valid-title rule should by default no longer complain if a function name is provided.

Before:

import { describe } from "vitest"

function isBodyWithReplies() { /* ... */ }

describe(isBodyWithReplies, () => {
	//   ~~~~~~~~~~~~~~~~~~ Test title must be a string
	// ...
})

After:

import { describe } from "vitest"

function isBodyWithReplies() { /* ... */ }

describe(isBodyWithReplies, () => {
	//   OK
	// ...
});

describe(1234567890, () => {
	//   ~~~~~~~~~~ Test title must be a function or string
	// ...
});

I'd be happy to send a PR for this! ❤️

JoshuaKGoldberg avatar Sep 06 '23 05:09 JoshuaKGoldberg

a PR would be much appreciated as always.

veritem avatar Sep 10 '23 03:09 veritem