Skip to content

Commit 88a73b1

Browse files
committed
fix: resolve lint warnings in publish_packages.js (issue #8087)
1 parent 0ed631d commit 88a73b1

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

lib/node_modules/@stdlib/_tools/scripts/publish_packages.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var topics = setTopics.factory({
8282

8383
var CURRENT_YEAR = currentYear();
8484

85-
var INSTALLATION_SECTION_BASIC = [
85+
var INSTALL_SEC_BASIC = [
8686
'<section class="installation">',
8787
'',
8888
'## Installation',
@@ -94,7 +94,7 @@ var INSTALLATION_SECTION_BASIC = [
9494
'</section>',
9595
''
9696
].join( '\n' );
97-
var INSTALLATION_SECTION_BUNDLES = [
97+
var INSTALL_SEC_BUNDLES = [
9898
'<section class="installation">',
9999
'',
100100
'## Installation',
@@ -116,11 +116,11 @@ var INSTALLATION_SECTION_BUNDLES = [
116116
'</section>',
117117
''
118118
].join( '\n' );
119-
var INSTALLATION_SECTION_BUNDLES_CLI = [
119+
var INSTALL_SEC_BUNDLES_CLI = [
120120
'- To use as a general utility for the command line, install the corresponding [CLI package][cli-section] globally.',
121121
''
122122
].join( '\n' );
123-
var CLI_INSTALLATION_SECTION = [
123+
var CLI_INSTALL_SEC = [
124124
'<section class="installation">',
125125
'',
126126
'## Installation',
@@ -339,8 +339,8 @@ var BASIC_GITHUB_TOPICS = [
339339
'node-js'
340340
];
341341
var RE_ALLOWED_TOPIC_CHARS = /^[A-Z0-9-]+$/i;
342-
var memoizedNPMversionForDeps = memoize( npmVersion );
343-
var memoizedNPMversionForDevDeps = memoize( npmVersion );
342+
var memoizedNPMverForDeps = memoize( npmVersion );
343+
var memoizedNPMverForDevDeps = memoize( npmVersion );
344344

345345

346346
// FUNCTIONS //
@@ -404,7 +404,7 @@ function populateDeps( pkgJSON, deps, devDeps, mainJSON, useGitHub ) {
404404
if ( useGitHub ) {
405405
out.dependencies[ dep ] = 'github:stdlib-js/' + replace( dep, '@stdlib/', '' ) + '#main';
406406
} else {
407-
out.dependencies[ dep ] = memoizedNPMversionForDeps( dep );
407+
out.dependencies[ dep ] = memoizedNPMverForDeps( dep );
408408
}
409409
}
410410
} else {
@@ -426,7 +426,8 @@ function populateDeps( pkgJSON, deps, devDeps, mainJSON, useGitHub ) {
426426
if ( useGitHub ) {
427427
out.devDependencies[ dep ] = 'github:stdlib-js/' + replace( dep, '@stdlib/', '' ) + '#main';
428428
} else {
429-
out.devDependencies[ dep ] = memoizedNPMversionForDevDeps( dep );
429+
out.devDependencies[ dep ] =
430+
memoizedNPMverForDevDeps( dep );
430431
}
431432
}
432433
} else {
@@ -840,7 +841,8 @@ function publish( pkg, clbk ) {
840841
if ( contains( readme, '<section class="links">' ) ) {
841842
readme = replace( readme, '<section class="links">', mainRepoSection( customLicense, branch, !noBundles, extractCLI ) );
842843
} else {
843-
readme += mainRepoSection( customLicense, branch, !noBundles, extractCLI );
844+
readme +=
845+
mainRepoSection( customLicense, branch, !noBundles, extractCLI );
844846
readme += '\n\n';
845847
readme += '</section>';
846848
readme += '\n\n';
@@ -1014,7 +1016,7 @@ function publish( pkg, clbk ) {
10141016

10151017
// Ensure `npm install` does not automatically build a native add-on...
10161018
if ( pkgJSON.gypfile ) {
1017-
// TODO: consider removing this once we have determined our native add-on story for individual packages
1019+
// Note: consider removing this once we have determined our native add-on story for individual packages
10181020
pkgJSON.gypfile = false;
10191021
}
10201022
pkgJSON.version = version;
@@ -1075,7 +1077,7 @@ function publish( pkg, clbk ) {
10751077
// Replace `@stdlib/bench` with `@stdlib/bench-harness` in standalone packages:
10761078
command = 'find '+dist+' -type f -name \'*.js\' -print0 | xargs -0 sed -i "s/\'@stdlib\\/bench\'/\'@stdlib\\/bench-harness\'/g"';
10771079
shell( command );
1078-
pkgJSON.devDependencies[ '@stdlib/bench-harness' ] = memoizedNPMversionForDevDeps( '@stdlib/bench-harness' );
1080+
pkgJSON.devDependencies[ '@stdlib/bench-harness' ] = memoizedNPMverForDevDeps( '@stdlib/bench-harness' );
10791081
delete pkgJSON.devDependencies[ '@stdlib/bench' ];
10801082
}
10811083
}
@@ -1104,7 +1106,7 @@ function publish( pkg, clbk ) {
11041106

11051107
// Add `@stdlib/error-tools-fmtprodmsg` in package.json if the package depends on `@stdlib/string-format`:
11061108
if ( pkgJSON.dependencies[ '@stdlib/string-format' ] ) {
1107-
fmtProdMsgVersion = memoizedNPMversionForDeps( '@stdlib/error-tools-fmtprodmsg' );
1109+
fmtProdMsgVersion = memoizedNPMverForDeps( '@stdlib/error-tools-fmtprodmsg' );
11081110
pkgJSON.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = fmtProdMsgVersion;
11091111
deps.push( '@stdlib/error-tools-fmtprodmsg' );
11101112
}
@@ -1319,17 +1321,17 @@ function publish( pkg, clbk ) {
13191321

13201322
if ( isString( p1 ) ) {
13211323
if ( startsWith( p1, '## CLI' ) ) {
1322-
return p1 + CLI_INSTALLATION_SECTION + ( p2 || '\n<!-- CLI usage documentation. -->\n' ) + '\n<section class="usage">';
1324+
return p1 + CLI_INSTALL_SEC + ( p2 || '\n<!-- CLI usage documentation. -->\n' ) + '\n<section class="usage">';
13231325
}
13241326
if ( startsWith( p1, '<!-- C usage documentation. -->' ) ) {
13251327
return p1 + '<section class="usage">';
13261328
}
13271329
}
13281330
if ( noBundles ) {
1329-
out = INSTALLATION_SECTION_BASIC;
1331+
out = INSTALL_SEC_BASIC;
13301332
} else {
1331-
out = INSTALLATION_SECTION_BUNDLES;
1332-
out = out.replace( '<cli>', ( extractCLI ) ? INSTALLATION_SECTION_BUNDLES_CLI : '' );
1333+
out = INSTALL_SEC_BUNDLES;
1334+
out = out.replace( '<cli>', ( extractCLI ) ? INSTALL_SEC_BUNDLES_CLI : '' );
13331335
}
13341336
out += '\n<section class="usage">';
13351337
return out;

0 commit comments

Comments
 (0)