【问题标题】:How to make IntelliJ IDEA lint TS script in .vue?如何在 .vue 中制作 IntelliJ IDEA lint TS 脚本?
【发布时间】:2018-09-06 08:23:57
【问题描述】:

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

我正在使用 tslint 为所有 TS 脚本提供统一的代码样式,它适用于所有 .ts 文件。 问题是,IDE 在 linting 我的 .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 发出 linter 警告。

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

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

知道我怎样才能让它工作吗?

【问题讨论】:

    标签: intellij-idea vue.js tslint


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-02-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-04
      • 1970-01-01
      相关资源
      最近更新 更多