如何在 .vue 中制作 IntelliJ IDEA lint TS 脚本?

Ábe*_*kes 6 intellij-idea vue.js tslint

我最近一直在使用 Vue 和 TypeScript,但我无法让它正常工作:

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

示例.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>
Run Code Online (Sandbox Code Playgroud)

如果将同一段代码放在 .ts 文件中,则会导致 IntelliJ IDEA 发出 linter 警告。

到目前为止我尝试过的:

  • 缓存失效并重启
  • 在 webpack 配置中设置 tslint-loader

知道我怎么能让这个工作吗?

len*_*ena 0

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