nursery/noPlaywrightUnsafeReferences
nursery · since 2.6.5
Unsafe autofixRecommended
biome.json
{
"linter": {
"rules": {
"nursery": {
"noPlaywrightUnsafeReferences": "error"
}
}
}
}Disallow using variables from outside the function passed to page.evaluate() and page.addInitScript().
const x = 7;
const y = 8;
await page.evaluate(() => x * y);const theme = "dark";
await page.addInitScript(() => {
localStorage.setItem("theme", theme);
});const x = 7;
const y = 8;
await page.evaluate(([x, y]) => x * y, [x, y]);
const theme = "dark";
await page.addInitScript((theme) => {
localStorage.setItem("theme", theme);
}, theme);
await page.evaluate(() => document.title);Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
nursery/noPlaywrightUnsafeReferences
nursery · since 2.6.5
{
"linter": {
"rules": {
"nursery": {
"noPlaywrightUnsafeReferences": "error"
}
}
}
}Enforce Playwright async APIs to be awaited or returned.
Disallow quickfix.biome in supported editor settings.
Disallow useVisibleTask$() functions in Qwik components.
Require var() when using a declared CSS custom property.
Disallow deep imports from the react-native package.