chore: lint code blocks in docs with ESLint (#42113)
This commit is contained in:
parent
4e61f5b26f
commit
0d70389ccb
51 changed files with 308 additions and 34 deletions
|
@ -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'))
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue