Fix @typescript-eslint/no-unsafe-return errors

This commit is contained in:
Labhansh Agrawal 2021-03-29 01:43:49 +05:30
parent c347ce8483
commit e266dd00f2
15 changed files with 41 additions and 16 deletions

View file

@ -1,3 +1,5 @@
// eslint-disable-next-line eslint-comments/disable-enable-pair
/* eslint-disable @typescript-eslint/no-unsafe-return */
import fs from 'fs';
import os from 'os';
import got from 'got';

View file

@ -84,8 +84,9 @@ const lsRemote = (pattern?: string) => {
const URL = `https://api.npms.io/v2/search?q=${
(pattern && `${pattern}+`) || ''
}keywords:hyper-plugin,hyper-theme&size=250`;
type npmResult = {package: {name: string; description: string}};
return got(URL)
.then((response) => JSON.parse(response.body).results as any[])
.then((response) => JSON.parse(response.body).results as npmResult[])
.then((entries) => entries.map((entry) => entry.package))
.then((entries) =>
entries.map(({name, description}) => {