Vitest
Vitest test source rules from @vitest/eslint-plugin. Vitest reuses much of Jestβs testing surface but ships its own runner and configuration. These rules mirror the ergonomic subset of eslint-plugin-jest adapted for Vitest semantics, focused tests, identical titles, conditional logic, valid expect shape.
Source: @vitest/eslint-plugin (MIT).
vitest/expect-expect: Require every Vitest test body to contain at least oneexpect(...)call.vitest/no-conditional-expect: Rejectexpect(...)calls underif/try/catchor other conditional branches in Vitest tests.vitest/no-conditional-tests: Rejecttest(...)/it(...)declarations inside loops orifbranches.vitest/no-disabled-tests: Rejecttest.skip,it.skip,describe.skip, and.todovariants.vitest/no-done-callback: Rejectdonecallback parameters in Vitest tests and lifecycle hooks.vitest/no-focused-tests: Rejecttest.only,it.only, anddescribe.only.vitest/no-identical-title: Reject duplicate Vitest test ordescribetitles within the same suite scope.vitest/no-standalone-expect: Rejectexpect(...)calls outside Vitest tests and hooks.vitest/no-test-return-statement: Rejectreturnstatements that return non-Promise values from a Vitest test callback.vitest/prefer-to-have-length: Preferexpect(value).toHaveLength(n)over asserting onvalue.lengthwithtoBe.vitest/valid-describe-callback: Validate the shape of Vitestdescribecallbacks.vitest/valid-expect: Validateexpect(...)arity and matcher chaining: exactly one argument, terminated by a matcher call, and async matchers properly awaited.vitest/valid-title: Require non-empty static Vitest test anddescribetitles.
Last updated on