chore: lint code blocks in docs with ESLint (#42113)

This commit is contained in:
David Sanders
2025-05-29 12:45:26 -07:00
committed by GitHub
parent 4e61f5b26f
commit 0d70389ccb
51 changed files with 308 additions and 34 deletions

View File

@@ -9,6 +9,7 @@ An example of implementing a protocol that has the same effect as the
```js
const { app, protocol, net } = require('electron')
const path = require('node:path')
const url = require('node:url')
@@ -38,8 +39,9 @@ to register it to that session explicitly.
```js
const { app, BrowserWindow, net, protocol, session } = require('electron')
const path = require('node:path')
const url = require('url')
const url = require('node:url')
app.whenReady().then(() => {
const partition = 'persist:example'
@@ -76,6 +78,7 @@ Policy:
```js
const { protocol } = require('electron')
protocol.registerSchemesAsPrivileged([
{ scheme: 'foo', privileges: { bypassCSP: true } }
])
@@ -128,8 +131,9 @@ Example:
```js
const { app, net, protocol } = require('electron')
const path = require('node:path')
const { pathToFileURL } = require('url')
const { pathToFileURL } = require('node:url')
protocol.registerSchemesAsPrivileged([
{
@@ -330,7 +334,8 @@ Example:
```js
const { protocol } = require('electron')
const { PassThrough } = require('stream')
const { PassThrough } = require('node:stream')
function createStream (text) {
const rv = new PassThrough() // PassThrough is also a Readable stream