Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// MODULES //

var exec = require( 'child_process' ).execSync;

Check warning on line 23 in lib/node_modules/@stdlib/_tools/bib/citation-reference/lib/sync.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected sync method: 'execSync'
var join = require( 'path' ).join;
var logger = require( 'debug' );
var copy = require( '@stdlib/utils/copy' );
Expand Down Expand Up @@ -60,7 +60,7 @@
*
* @example
* var ref = toReference( '@press1992' );
* // returns '...'
* // e.g., returns '...'
*/
function toReference( id, options ) {
var outFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// MODULES //

var execSync = require( 'child_process' ).execSync;

Check warning on line 23 in lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected sync method: 'execSync'
var replace = require( '@stdlib/string/replace' );


Expand All @@ -39,8 +39,8 @@
* @returns {Object} validators
*/
function main( context ) {
var source = context.getSourceCode();
var filename = context.getFilename();
var source = context.getSourceCode();

return {
'Program': validate
Expand Down Expand Up @@ -106,7 +106,7 @@
if ( year !== expected ) {
report( 'Expected year to be '+expected+' and not '+year, comment, expected );
}
} catch ( err ) {
} catch ( err ) { // eslint-disable-line no-unused-vars
// Do nothing if unable to determine the year the file was created (e.g., if the file is not tracked yet by `git`).
}
}
Expand Down
Copy link
Member

Choose a reason for hiding this comment

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

When editing this file, you needed to spend some time actually understanding what was being measured. In this case, we explicitly wanted to use new Array(...) as we were explicitly benchmarking its performance.

Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ function copy1( arr ) {

len = arr.length;
if ( len > MAX_FAST_ELEMENTS_HEURISTIC ) {
out = new Array( MAX_FAST_ELEMENTS_HEURISTIC );
out = new Array( MAX_FAST_ELEMENTS_HEURISTIC ); // eslint-disable-line stdlib/no-new-array
for ( i = 0; i < MAX_FAST_ELEMENTS_HEURISTIC; i++ ) {
out[ i ] = arr[ i ];
}
for ( i = MAX_FAST_ELEMENTS_HEURISTIC; i < len; i++ ) {
out.push( arr[ i ] );
}
} else {
out = new Array( len );
out = new Array( len ); // eslint-disable-line stdlib/no-new-array
for ( i = 0; i < len; i++ ) {
out[ i ] = arr[ i ];
}
Expand All @@ -89,7 +89,7 @@ function copy2( arr ) {
var i;

len = arr.length;
out = new Array( len );
out = new Array( len ); // eslint-disable-line stdlib/no-new-array
for ( i = 0; i < len; i++ ) {
out[ i ] = arr[ i ];
}
Expand Down
Loading