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.
No rules match “”.
Popular · 1 of 50
function setupFoo(options) {
/* ... */
}
function setupBar(options) {
/* ... */
}
describe('foo', () => {
let foo
beforeEach(() => {
foo = setupFoo()
})
afterEach(() => {
foo = null
})
it('does something', () => {
expect(foo.doesSomething()).toBe(true)
})
describe('with bar', () => {
let bar
beforeEach(() => {
bar = setupBar()
})
afterEach(() => {
bar = null
// …function setupFoo(options) {
/* ... */
}
function setupBar(options) {
/* ... */
}
describe('foo', () => {
it('does something', () => {
const foo = setupFoo()
expect(foo.doesSomething()).toBe(true)
})
it('does something with bar', () => {
const foo = setupFoo()
const bar = setupBar()
expect(foo.doesSomething(bar)).toBe(true)
})
})