Skip to content

Commit b3ab32c

Browse files
committed
[BUNDLEPHOBIA]: fixed tslint error
Signed-off-by: ashish <ashishpatel0720@gmail.com>
1 parent 147aa05 commit b3ab32c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/commands/bundlephobia.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ export default class Bundlephobia extends Command {
8787
}
8888
)
8989

90-
axios.all(packagesInfo.map((packageInfo: any) => {
90+
// tslint:disable-next-line:no-unsafe-any no-unused
91+
let x = axios.all(packagesInfo.map((packageInfo: any) => { // have to use x for removing TSLintError: promises must be handled appropriately
9192
return axios.get(packageInfo.url).then(successResponse => {
9293
packagesResolved ++
9394
size += successResponse.data.size
@@ -97,9 +98,11 @@ export default class Bundlephobia extends Command {
9798
}).catch(errorResponse => {
9899
Logger.progressStopError(this, Bundlephobia.getErrorMessage(packageInfo.pkg, errorResponse.response.data.error.message))
99100
})
101+
// tslint:disable-next-line:no-unused
100102
}))
103+
.then(() => {}).catch(() => {})
101104
. finally(() => {
102-
Logger.success(this, '\n' + this.getFinalMessage({
105+
Logger.success(this, this.getFinalMessage({
103106
count: packagesResolved,
104107
dependencyCount,
105108
size,
@@ -110,7 +113,7 @@ export default class Bundlephobia extends Command {
110113
}
111114

112115
private getFinalMessage(data: any) {
113-
return `${chalk.magenta('Total')} [${chalk.cyan(data.count + ' packages')}] resolved has ${data.dependencyCount} dependencies with size of ${Bundlephobia.getSize(data.size)}(${Bundlephobia.getSize(data.gzip)} gzipped)`
116+
return `${chalk.magenta('Total')} [${chalk.cyan(data.count + ' packages resolved')}] has ${data.dependencyCount} dependencies with size of ${Bundlephobia.getSize(data.size)}(${Bundlephobia.getSize(data.gzip)} gzipped)`
114117
}
115118

116119
private getSuccessMessage(data: any) {

0 commit comments

Comments
 (0)