Skip to main content

no-electron-enable-remote-module

Disallow enabling Electron webPreferences.enableRemoteModule.

Targeted pattern scopeโ€‹

This rule targets Electron BrowserWindow and BrowserView constructor options that set webPreferences.enableRemoteModule to true.

What this rule reportsโ€‹

This rule reports webPreferences.enableRemoteModule: true in Electron renderer configuration objects.

Why this rule existsโ€‹

Enabling the remote module expands renderer access to privileged main-process capabilities and weakens isolation boundaries.

โŒ Incorrectโ€‹

new BrowserWindow({
webPreferences: {
enableRemoteModule: true,
},
});

โœ… Correctโ€‹

new BrowserWindow({
webPreferences: {
enableRemoteModule: false,
},
});

ESLint flat config exampleโ€‹

import sdl from "eslint-plugin-sdl-2";

export default [
{
plugins: { sdl },
rules: {
"sdl/no-electron-enable-remote-module": "error",
},
},
];

When not to use itโ€‹

Disable only for legacy Electron versions where remote cannot be removed yet, with strict migration and deprecation plans.

Package documentationโ€‹

Further readingโ€‹

Rule catalog ID: R014