Boolean(process.env.CI)
instead 8export default defineConfig({
9 testDir: "./e2e",
10 fullyParallel: true,
11 forbidOnly: !!process.env.CI,12 retries: process.env.CI ? 2 : 0,
13 workers: process.env.CI ? 1 : undefined,
14 reporter: "html",
Prefer using explicit casts by calling Number
, Boolean
, or String
over using operators like +
, !!
or "" +
.
This is considered best practice as it improves readability.
const b = !!foo;
// The `+` operator does not change the value of its operand
// unless it's already a number.
let n = +foo;
n = 1 * foo;
const s = "" + foo;
const b = Boolean(foo);
const n = Number(foo);
const s = String(foo);