Skip to content

chore: fix JavaScript lint errors (issue #10000) - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)#10307

Open
Sid-V5 wants to merge 1 commit intostdlib-js:developfrom
Sid-V5:fix/lint-proc-undefined

Conversation

@Sid-V5
Copy link

@Sid-V5 Sid-V5 commented Feb 15, 2026

Fixed the no-undef ESLint errors in makie-install-node-addons/lib/main.js by replacing undefined proc references with process.

Resolves #10000

Problem

Four module-scoped callback functions (onError, onFinish, stdout, stderr) reference proc, but proc is only declared as a local variable inside the plugin() function. This causes 4 ESLint no-undef errors:

35:2  error  'proc' is not defined  no-undef
48:3  error  'proc' is not defined  no-undef
60:2  error  'proc' is not defined  no-undef
70:2  error  'proc' is not defined  no-undef

Fix

The callbacks use proc.exitCode, proc.stdout.write(), and proc.stderr.write() these are operations on the Node.js global process object, not the child process spawned inside plugin(). Replaced all 4 occurrences of proc with process in the module-scoped callbacks:

 function onError( error ) {
-	proc.exitCode = 1;
+	process.exitCode = 1;

 function onFinish( code ) {
-		proc.exitCode = code;
+		process.exitCode = code;

 function stdout( data ) {
-	proc.stdout.write( data );
+	process.stdout.write( data );

 function stderr( data ) {
-	proc.stderr.write( data );
+	process.stderr.write( data );

The local var proc inside plugin() continues to hold the child process handle from spawn() and is unaffected.

Replace undefined `proc` references with `process` in module-scoped
callback functions. The `proc` variable is only declared inside the
`plugin()` function scope, but the callbacks `onError`, `onFinish`,
`stdout`, and `stderr` are defined at module scope and need to access
the Node.js global `process` object for exitCode and stdio streams.
@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot stdlib-bot added Tools Issue or pull request related to project tooling. Good First PR A pull request resolving a Good First Issue. First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review. labels Feb 15, 2026
@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@Sid-V5 Sid-V5 changed the title chore: fix JavaScript lint errors (issue #10000) chore: fix JavaScript lint errors (issue #10000) - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) Feb 15, 2026
@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

4 similar comments
@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening a PR!

*/
function onError( error ) {
proc.exitCode = 1;
process.exitCode = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The right fix here is to add the missing import rather than switching to the process global.

If you look at every other sibling makie plugin (e.g., makie-test, makie-benchmark, makie-examples -- all 21 of them), they all have this at line 23:

var proc = require( 'process' );
var spawn = require( 'child_process' ).spawn;

This file is the only one missing that require( 'process' ) import. That's the actual root cause of the lint error.

The fix should be to add var proc = require( 'process' ); before the spawn require (line 23) and then revert all four callback changes back to using proc. This keeps consistency with every other plugin in this directory and follows the stdlib convention of using require('process') rather than relying on the process global.

@Planeshifter Planeshifter added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Feb 16, 2026
@stdlib-bot stdlib-bot added the Potential Duplicate There might be another pull request resolving the same issue. label Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Good First PR A pull request resolving a Good First Issue. Needs Changes Pull request which needs changes before being merged. Potential Duplicate There might be another pull request resolving the same issue. Tools Issue or pull request related to project tooling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

3 participants