Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorEdu93Jer <mailing_93@hotmail.com>2020-12-16 02:49:38 +0300
committerisaacs <i@izs.me>2020-12-18 22:35:16 +0300
commita92d310b7e9e4c48b08f52785c2e3a6d52a82ad7 (patch)
tree60a615230082a8cdac3d357ae7c59cbd94b0211d /lib/utils
parentbe4a0900b14b2c6315bf62bed8f5affb648215ae (diff)
Add max-len to lint rules
PR-URL: https://github.com/npm/cli/pull/2361 Credit: @Edu93Jer Close: #2361 Reviewed-by: @isaacs EDIT(@isaacs): amended to match some of the fixes to our current style conventions
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/error-message.js12
-rw-r--r--lib/utils/file-exists.js4
-rw-r--r--lib/utils/reify-output.js2
3 files changed, 12 insertions, 6 deletions
diff --git a/lib/utils/error-message.js b/lib/utils/error-message.js
index 695b497ab..ac5a935dc 100644
--- a/lib/utils/error-message.js
+++ b/lib/utils/error-message.js
@@ -193,10 +193,14 @@ module.exports = (er) => {
else {
detail.push(['404', 'This package name is not valid, because', ''])
- const errorsArray = (valResult.errors || []).concat(valResult.warnings || [])
- errorsArray.forEach(function (item, idx) {
- detail.push(['404', ' ' + (idx + 1) + '. ' + item])
- })
+ const errorsArray = [
+ ...(valResult.errors || []),
+ ...(valResult.warnings || []),
+ ]
+ errorsArray.forEach((item, idx) => detail.push([
+ '404',
+ ' ' + (idx + 1) + '. ' + item,
+ ]))
}
detail.push(['404', '\nNote that you can also install from a'])
diff --git a/lib/utils/file-exists.js b/lib/utils/file-exists.js
index 3149c0ae5..605472536 100644
--- a/lib/utils/file-exists.js
+++ b/lib/utils/file-exists.js
@@ -3,6 +3,8 @@ const util = require('util')
const stat = util.promisify(fs.stat)
-const fileExists = (file) => stat(file).then((stat) => stat.isFile()).catch(() => false)
+const fileExists = (file) => stat(file)
+ .then((stat) => stat.isFile())
+ .catch(() => false)
module.exports = fileExists
diff --git a/lib/utils/reify-output.js b/lib/utils/reify-output.js
index ed5733487..4abaadc2e 100644
--- a/lib/utils/reify-output.js
+++ b/lib/utils/reify-output.js
@@ -1,7 +1,7 @@
// pass in an arborist object, and it'll output the data about what
// was done, what was audited, etc.
//
-// added 351 packages, removed 132 packages, and audited 13388 packages in 19.157s
+// added ## packages, removed ## packages, and audited ## packages in 19.157s
//
// 1 package is looking for funding
// run `npm fund` for details