eslint-plugin-vitest
eslint-plugin-vitest copied to clipboard
valid-title should allow functions
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! ❤️
a PR would be much appreciated as always.