在lint暂存时解析TSLint

问题描述

当我要对以下代码片段进行更改时,我无法顺利完成该工作:

export const getStaticPaths = localisedStaticPathsGetter(() => 
  require('utils/server/')
    .getContentList('pages',true)
    .map((slug: string) => ({ slug }))
);

它产生了这个

  51:3  error  Unsafe return of an any typed value                   @typescript-eslint/no-unsafe-return
  51:3  error  Unsafe member access .map on an any value             @typescript-eslint/no-unsafe-member-access
  51:3  error  Unsafe call of an any typed value                     @typescript-eslint/no-unsafe-call
  51:3  error  Unsafe member access .getContentList on an any value  @typescript-eslint/no-unsafe-member-access
  51:3  error  Unsafe call of an any typed value                     @typescript-eslint/no-unsafe-call
  51:3  error  Require statement not part of import statement        @typescript-eslint/no-var-requires

如何通过传递来解决

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)