How to make IntelliJ IDEA lint TS script in .vue?

徘徊边缘 提交于 2019-12-06 07:09:54

问题


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

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:

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

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:

  • Cache invalidate & restart
  • Setting tslint-loader in webpack config

Any idea how could i get this working?


回答1:


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.



来源:https://stackoverflow.com/questions/49521143/how-to-make-intellij-idea-lint-ts-script-in-vue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!