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
commit 0d70389ccb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
51 changed files with 308 additions and 34 deletions

View file

@ -269,8 +269,10 @@ Let's break down this code:
Now, let's create a JavaScript wrapper to make the addon easier to use. Create `js/index.js`:
<!-- eslint-disable import/newline-after-import,import/order -->
```js title='js/index.js' @ts-expect-error=[5]
const EventEmitter = require('events')
const EventEmitter = require('node:events')
// Load the native addon using the 'bindings' module
// This will look for the compiled .node file in various places
@ -362,6 +364,7 @@ To use this addon in an Electron application, you would:
```js @ts-expect-error=[2]
// In your main process
const myAddon = require('my-native-addon')
console.log(myAddon.helloWorld('Electron'))
```