如何在.vue中制作IntelliJ IDEA棉绒TS脚本? [英] How to make IntelliJ IDEA lint TS script in .vue?

查看:327
本文介绍了如何在.vue中制作IntelliJ IDEA棉绒TS脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在与Vue& TypeScript,最近我无法正常工作:

I've been working with Vue & TypeScript lately, and I just can't get this working:

我正在使用tslint在所有TS脚本上提供统一的代码样式,并且适用于所有.ts文件. 问题是,在整理我的.vue文件时,IDE使用其默认设置.

I'm using tslint to provide a unified code style on all TS script, and it works well for all .ts files. The problem is, that the IDE uses its default settings when linting my .vue files.

Example.vue:

Example.vue:

<template>
  <div>Example</div>
</template>
<script lang="ts">
  import Component from "vue-class-component"; //<-- not complaining for double-quotes
  import Vue from 'vue';

  @Component
  export default class Example extends Vue {}
</script>

如果将相同的代码放入.ts文件中,则IntelliJ IDEA会发出短绒警告.

The same piece of code is resulting in a linter warning by IntelliJ IDEA if put in a .ts file.

到目前为止我已经尝试过的:

What I've tried so far:

  • 缓存无效&重新启动
  • 在webpack配置中设置tslint-loader

任何想法我怎么能使它正常工作?

Any idea how could i get this working?

推荐答案

我们有一项功能要求,以支持.vue中的TSLint- WEB-31044 .请关注它以获取更新. 请注意,TSLint本身当前不支持Lining Vue单文件组件-请参见 https://github .com/palantir/tslint/issues/2099 .

We have a feature request to support TSLint in .vue - WEB-31044. Please follow it for updates. Note that TSLint itself doesn't currently support linting Vue single-file components - see https://github.com/palantir/tslint/issues/2099.

这篇关于如何在.vue中制作IntelliJ IDEA棉绒TS脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆