no-electron-experimental-features
Disallow enabling Electron webPreferences.experimentalFeatures.
Targeted pattern scopeโ
This rule targets Electron BrowserWindow and BrowserView constructor options
that set webPreferences.experimentalFeatures to true.
What this rule reportsโ
This rule reports webPreferences.experimentalFeatures: true in Electron
renderer configuration objects.
Why this rule existsโ
Electron recommends disabling experimental platform features in production renderers because they expand the runtime surface area and can bypass hardening assumptions.
โ Incorrectโ
new BrowserWindow({
webPreferences: {
experimentalFeatures: true,
},
});
โ Correctโ
new BrowserWindow({
webPreferences: {
experimentalFeatures: false,
},
});
Behavior and migration notesโ
This rule includes an autofix for literal boolean values.
experimentalFeatures: trueis rewritten toexperimentalFeatures: false.
ESLint flat config exampleโ
import sdl from "eslint-plugin-sdl-2";
export default [
{
plugins: { sdl },
rules: {
"sdl/no-electron-experimental-features": "error",
},
},
];
When not to use itโ
Disable only for short-lived experiments that explicitly require Electron experimental features and are isolated behind documented review gates.
Package documentationโ
Further readingโ
Rule catalog ID: R046