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.
test("adds two numbers", () => {
return expect(add(1, 2)).toBe(3);
});test("adds two numbers", () => {
expect(add(1, 2)).toBe(3);
});
test("subtracts two numbers", () => expect(subtract(3, 2)).toBe(1));
it("loads the user", async () => {
const user = await loadUser();
expect(user.name).toBe("Ada");
});
it("saves the user", async () => {
if (isReadOnly) {
return;
}
await saveUser();
});Popular · 1 of 2
Disallow explicitly returning from tests
test("adds two numbers", () => {
return expect(add(1, 2)).toBe(3);
});test("adds two numbers", () => {
expect(add(1, 2)).toBe(3);
});
test("subtracts two numbers", () => expect(subtract(3, 2)).toBe(1));
it("loads the user", async () => {
const user = await loadUser();
expect(user.name).toBe("Ada");
});
it("saves the user", async () => {
if (isReadOnly) {
return;
}
await saveUser();
});