chore: extend linting of code blocks in the docs (#40245)

* chore: extend linting of code blocks in the docs

* chore: combine lint:markdownlint and lint:markdown scripts
This commit is contained in:
David Sanders 2023-11-20 23:50:08 -08:00 committed by GitHub
parent d6bb9b40b0
commit 3d2a754531
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
71 changed files with 510 additions and 286 deletions

View file

@ -6,7 +6,7 @@ Process: [Renderer](../glossary.md#renderer-process)
An example of exposing an API to a renderer from an isolated preload script is given below:
```javascript
```js
// Preload (Isolated World)
const { contextBridge, ipcRenderer } = require('electron')
@ -18,7 +18,7 @@ contextBridge.exposeInMainWorld(
)
```
```javascript @ts-nocheck
```js @ts-nocheck
// Renderer (Main World)
window.electron.doThing()
@ -64,7 +64,7 @@ the API become immutable and updates on either side of the bridge do not result
An example of a complex API is shown below:
```javascript
```js
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld(
@ -92,7 +92,7 @@ contextBridge.exposeInMainWorld(
An example of `exposeInIsolatedWorld` is shown below:
```javascript
```js
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInIsolatedWorld(
@ -104,7 +104,7 @@ contextBridge.exposeInIsolatedWorld(
)
```
```javascript @ts-nocheck
```js @ts-nocheck
// Renderer (In isolated world id1004)
window.electron.doThing()
@ -145,7 +145,7 @@ The table of supported types described above also applies to Node APIs that you
Please note that many Node APIs grant access to local system resources.
Be very cautious about which globals and APIs you expose to untrusted remote content.
```javascript
```js
const { contextBridge } = require('electron')
const crypto = require('node:crypto')
contextBridge.exposeInMainWorld('nodeCrypto', {