// I get @typescript-eslint of [Unexpected any. Specify a different type.eslint(@typescript-eslint/no-explicit-any)]
const funcToGetOnlineData: (url: string) => any = () => {
// const httpData = (some processes to retrieve http request data)
// return httpData;
};
funcToGetOnlineData('http://getsomedata.com');
我知道将返回值转换any
为不是一个好习惯。但是,有时我们确实需要这个。即通过HTTP 请求获取形状未知的数据。在不禁用这些行的 ESlint 规则的情况下,是否有任何标准方法/实践来摆脱这种情况?