0

打字稿文件充满了警告符号,我试图忽略 .eslintrc.json 文件中的以下规则:

  1. 我想允许任何类型
  2. 我想忽略在不返回任何内容的函数后面设置 void 。

这些是相应的警告:

  1. 参数“myArgument”应该是 typed.eslint@typescript-eslint/explicit-module-boundary-types
  2. function.eslint@typescript-eslint/explicit-module-boundary-types 上缺少返回类型

有没有办法忽略这些规则并使警告消失?

4

1 回答 1

2

对于any,您可以使用"no-explicit-any":false

对于void,您可以使用"no-void": false

对于您的其他警告,eslint 规则是explicit-module-boundary-types

你可能需要

 "@typescript-eslint/explicit-module-boundary-types": "off"

停止 typescript-eslint/explicit-module-boundary-types 应用于不使用 Typescript 的 vue 组件

于 2020-09-29T18:17:52.350 回答