【发布时间】:2021-09-24 00:40:44
【问题描述】:
我已尝试导出如下所示的控制器
export const IndexController: Router = Router();
我收到以下错误:
A function with a name starting with an uppercase letter should only be used as a constructor.eslintnew-cap
我尝试使用“new”运算符作为开头,但出现以下错误。
'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.
我知道的唯一解决方案是添加注释 eslint-disable-next-line new-cap 但这不可行,我不想每次要导出控制器时都粘贴它。
【问题讨论】:
标签: typescript eslint typescript-eslint