繁体   English   中英

ESLint:忽略警告规则

[英]ESLint: ignore warning rules

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

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

这些是相应的警告:

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

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

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

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

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

你可能需要

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM