Skip to content

Commit 2360c34

Browse files
committed
chore: fix JavaScript lint errors (issue #10000)
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent d660cab commit 2360c34

File tree

1 file changed

+20
-19
lines changed
  • lib/node_modules/@stdlib/_tools/makie/plugins/makie-install-node-addons/lib

1 file changed

+20
-19
lines changed

lib/node_modules/@stdlib/_tools/makie/plugins/makie-install-node-addons/lib/main.js

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// MODULES //
2222

2323
var spawn = require( 'child_process' ).spawn;
24+
var proc = require( 'process' );
2425

2526

2627
// FUNCTIONS //
@@ -31,9 +32,9 @@ var spawn = require( 'child_process' ).spawn;
3132
* @private
3233
* @param {Error} error - error object
3334
*/
34-
function onError( error ) {
35+
function onError(error) {
3536
proc.exitCode = 1;
36-
console.error( 'Error: %s', error.message ); // eslint-disable-line no-console
37+
console.error('Error: %s', error.message); // eslint-disable-line no-console
3738
}
3839

3940
/**
@@ -43,10 +44,10 @@ function onError( error ) {
4344
* @param {number} code - exit code
4445
* @returns {void}
4546
*/
46-
function onFinish( code ) {
47-
if ( code !== 0 ) {
47+
function onFinish(code) {
48+
if (code !== 0) {
4849
proc.exitCode = code;
49-
return console.error( 'Child process exited with code `'+code + '`.' ); // eslint-disable-line no-console
50+
return console.error('Child process exited with code `' + code + '`.'); // eslint-disable-line no-console
5051
}
5152
}
5253

@@ -56,8 +57,8 @@ function onFinish( code ) {
5657
* @private
5758
* @param {Buffer} data - standard output
5859
*/
59-
function stdout( data ) {
60-
proc.stdout.write( data );
60+
function stdout(data) {
61+
proc.stdout.write(data);
6162
}
6263

6364
/**
@@ -66,8 +67,8 @@ function stdout( data ) {
6667
* @private
6768
* @param {Buffer} data - standard error
6869
*/
69-
function stderr( data ) {
70-
proc.stderr.write( data );
70+
function stderr(data) {
71+
proc.stderr.write(data);
7172
}
7273

7374

@@ -80,7 +81,7 @@ function stderr( data ) {
8081
* @param {string} cwd - current working directory
8182
* @param {string} subpath - subdirectory path
8283
*/
83-
function plugin( dir, cwd, subpath ) {
84+
function plugin(dir, cwd, subpath) {
8485
var opts;
8586
var args;
8687
var proc;
@@ -91,18 +92,18 @@ function plugin( dir, cwd, subpath ) {
9192
args = [];
9293

9394
// Environment variables:
94-
if ( subpath ) {
95-
subpath = subpath.substring( 17 ); // removes 'lib/node_modules/'
96-
args.push( 'NODE_ADDONS_PATTERN='+subpath );
95+
if (subpath) {
96+
subpath = subpath.substring(17); // removes 'lib/node_modules/'
97+
args.push('NODE_ADDONS_PATTERN=' + subpath);
9798
}
9899
// Target:
99-
args.push( 'install-node-addons' );
100+
args.push('install-node-addons');
100101

101-
proc = spawn( 'make', args, opts );
102-
proc.on( 'error', onError );
103-
proc.stdout.on( 'data', stdout );
104-
proc.stderr.on( 'data', stderr );
105-
proc.on( 'close', onFinish );
102+
proc = spawn('make', args, opts);
103+
proc.on('error', onError);
104+
proc.stdout.on('data', stdout);
105+
proc.stderr.on('data', stderr);
106+
proc.on('close', onFinish);
106107
}
107108

108109

0 commit comments

Comments
 (0)