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

@@ -40,6 +40,7 @@ the window after this event will have no visual flash:
```js
const { BrowserWindow } = require('electron')
const win = new BrowserWindow({ show: false })
win.once('ready-to-show', () => {
win.show()
@@ -373,6 +374,7 @@ e.g. `APPCOMMAND_BROWSER_BACKWARD` is emitted as `browser-backward`.
```js
const { BrowserWindow } = require('electron')
const win = new BrowserWindow()
win.on('app-command', (e, cmd) => {
// Navigate the window back when the user hits their mouse back button
@@ -820,6 +822,7 @@ Resizes and moves the window to the supplied bounds. Any properties that are not
```js
const { BrowserWindow } = require('electron')
const win = new BrowserWindow()
// set all bounds properties
@@ -1080,6 +1083,7 @@ a HTML-rendered toolbar. For example:
```js
const { BrowserWindow } = require('electron')
const win = new BrowserWindow()
const toolbarRect = document.getElementById('toolbar').getBoundingClientRect()
@@ -1232,9 +1236,10 @@ method:
```js
const { BrowserWindow } = require('electron')
const win = new BrowserWindow()
const url = require('url').format({
const url = require('node:url').format({
protocol: 'file',
slashes: true,
pathname: require('node:path').join(__dirname, 'index.html')
@@ -1248,6 +1253,7 @@ the following:
```js
const { BrowserWindow } = require('electron')
const win = new BrowserWindow()
win.loadURL('http://localhost:8000/post', {