【发布时间】:2020-12-15 23:12:04
【问题描述】:
我正在使用vue,我刚刚更新了@typescript-eslint/eslint-plugin": "^3.10.1"。我的项目包含几个组件。他们中的一些人使用javascript 和其他人typescript。
警告
我对 non typescript 组件中的方法有此警告
警告:函数缺少返回类型 (@typescript-eslint/explicit-module-boundary-types)
问题
我怎么能不将此规则应用于未使用 <script lang="ts"> 的 .vue 文件?
【问题讨论】:
-
我也面临同样的问题。这似乎是
eslint-plugin-vue插件的限制——它将 Typescript 规则应用于 Vue javascript<script>vs. Typescript<script lang="ts"单文件组件。很遗憾,在重用来自其他地方的这种混合组件时,我们无法获得干净的 eslint 输出。你找到解决办法了吗?
标签: typescript vue.js typescript-eslint