Skip to content
Merged
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 @@ -70,7 +70,7 @@
var b;
var i;

// FIXME: clean-up this logic

Check warning on line 73 in lib/node_modules/@stdlib/_tools/repl-txt/rules/doctest/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'fixme' comment: 'FIXME: clean-up this logic'

if ( context.meta.filepath ) {
expected = [];
Expand All @@ -83,7 +83,7 @@
};
pkgName = pkg2alias( pkg ) || 'ALIAS';

// TODO: use @stdlib/utils/deep-set once refactored!

Check warning on line 86 in lib/node_modules/@stdlib/_tools/repl-txt/rules/doctest/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'todo' comment: 'TODO: use @stdlib/utils/deep-set once...'
pkgName = pkgName.split( '.' );
N = pkgName.length;
o = scope;
Expand All @@ -98,7 +98,7 @@
o[ key ] = require( pkg ); // eslint-disable-line stdlib/no-dynamic-require
}
}
// TODO: process external aliases *BEFORE* creating the context (and also, what is going on here, given that the return value is ignored?)

Check warning on line 101 in lib/node_modules/@stdlib/_tools/repl-txt/rules/doctest/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'todo' comment: 'TODO: process external aliases *BEFORE*...'
vm.createContext( scope );

examples = section.examples;
Expand Down Expand Up @@ -165,12 +165,12 @@
return format( 'require(\'%s\')', pkg );
}
// If an alias does not exist in the global namespace, dynamically `require` a package so that the desired expression can be executed:
return format( 'require(\'%s\')', pkg );
return format( '(require(\'%s\'))', pkg );
}
alias = alias.split( '.' );
len = alias.length;

// TODO: use @stdlib/utils/deep-set once refactored!

Check warning on line 173 in lib/node_modules/@stdlib/_tools/repl-txt/rules/doctest/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'todo' comment: 'TODO: use @stdlib/utils/deep-set once...'
o = scope;
for ( i = 0; i < len; i++ ) {
key = alias[ i ];
Expand Down
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/repl/help/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
*
* @private
*/
function main() {

Check warning on line 93 in lib/node_modules/@stdlib/repl/help/scripts/build.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Function 'main' has too many statements (119). Maximum allowed is 100
var related;
var fpath;
var alias;
Expand Down Expand Up @@ -180,11 +180,11 @@
// If an error was returned, we were unable to import the package...
if ( err instanceof Error ) {
debug( 'Unable to resolve package: %s.', p );
console.warn( 'WARNING: unable to resolve package `%s` for `%s`.', p, alias );

Check warning on line 183 in lib/node_modules/@stdlib/repl/help/scripts/build.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected console statement
continue;
}
// If an alias does not exist in the global namespace, dynamically `require` a package so that the desired expression can be executed in example code:
file = replace( file, tmp[ j ], format( 'require(\'%s\')', p ) ); // WARNING: this assumes that `{{alias:}}` placeholders are in examples. If unresolved package identifiers are used in descriptions, this substitution is NOT appropriate. The use of such placeholders in description prose is uncommon, but not unheard of. However, given its relatively rare occurrence, we can likely be confident that this substitution is okay. Ideally, identifiers would be added to the database, so that this workaround is not necessary.
file = replace( file, tmp[ j ], format( '(require(\'%s\'))', p ) ); // WARNING: this assumes that `{{alias:}}` placeholders are in examples. If unresolved package identifiers are used in descriptions, this substitution is NOT appropriate. The use of such placeholders in description prose is uncommon, but not unheard of. However, given its relatively rare occurrence, we can likely be confident that this substitution is okay. Ideally, identifiers would be added to the database, so that this workaround is not necessary.

Check warning on line 187 in lib/node_modules/@stdlib/repl/help/scripts/build.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'warning' comment: 'WARNING: this assumes that `{{alias:}}`...'
debug( 'Inserted a `require` expression for `%s`.', p );
} else {
file = replace( file, tmp[ j ], a );
Expand Down Expand Up @@ -236,7 +236,7 @@
continue;
}
if ( hasOwnProp( json, tmp ) ) {
// Concatenate associated signatures (e.g., same API, but multiple parameterizations based on argument types, etc):

Check warning on line 239 in lib/node_modules/@stdlib/repl/help/scripts/build.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "parameterizations"
json[ tmp ] += ast[ j ].raw;
} else {
json[ tmp ] = '\n' + ast[ j ].raw;
Expand Down