Rules
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
it('wrong1', async () => {
await expect(async () => {
await doSomethingAsync()
}).rejects.toThrow()
})
it('wrong2', async () => {
await expect(async function () {
await doSomethingAsync()
}).rejects.toThrow()
})
it('wrong3', async () => {
await expect(async () => await doSomethingAsync()).rejects.toThrow()
})it('right1', async () => {
await expect(doSomethingAsync()).rejects.toThrow()
})Popular · 1 of 50
Disallow unnecessary async function wrapper for expected promises
it('wrong1', async () => {
await expect(async () => {
await doSomethingAsync()
}).rejects.toThrow()
})
it('wrong2', async () => {
await expect(async function () {
await doSomethingAsync()
}).rejects.toThrow()
})
it('wrong3', async () => {
await expect(async () => await doSomethingAsync()).rejects.toThrow()
})it('right1', async () => {
await expect(doSomethingAsync()).rejects.toThrow()
})