vitest/no-duplicate-hooks
January 2, 2026 ยท View on GitHub
๐ Disallow duplicate hooks and teardown hooks.
โ ๏ธ This rule warns in the ๐ all config.
Rule Details
This rule aims to prevent duplicate hooks and teardown hooks.
Examples of incorrect code for this rule:
test('foo', () => {
beforeEach(() => {})
beforeEach(() => {}) // duplicate beforeEach
})
Examples of correct code for this rule:
test('foo', () => {
beforeEach(() => {})
})