簡體   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