如何在 .vue 中制作 IntelliJ IDEA lint TS 脚本?
How to make IntelliJ IDEA lint TS script in .vue?
我最近一直在使用 Vue 和 TypeScript,但我无法正常工作:
我正在使用 tslint 为所有 TS 脚本提供统一的代码风格,它适用于所有 .ts 文件。
问题是,IDE 在检查我的 .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>
同一段代码会导致 IntelliJ 发出 linter 警告 IDEA 如果放在 .ts 文件中。
到目前为止我尝试过的:
- 缓存失效并重新启动
- 在 webpack 配置中设置 tslint-loader
知道我怎样才能让它工作吗?
我们有一个在 .vue 中支持 TSLint 的功能请求 - WEB-31044。请关注它以获取更新。
请注意,TSLint 本身目前不支持 linting Vue single-file 组件 - 请参阅 https://github.com/palantir/tslint/issues/2099.
我最近一直在使用 Vue 和 TypeScript,但我无法正常工作:
我正在使用 tslint 为所有 TS 脚本提供统一的代码风格,它适用于所有 .ts 文件。 问题是,IDE 在检查我的 .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>
同一段代码会导致 IntelliJ 发出 linter 警告 IDEA 如果放在 .ts 文件中。
到目前为止我尝试过的:
- 缓存失效并重新启动
- 在 webpack 配置中设置 tslint-loader
知道我怎样才能让它工作吗?
我们有一个在 .vue 中支持 TSLint 的功能请求 - WEB-31044。请关注它以获取更新。 请注意,TSLint 本身目前不支持 linting Vue single-file 组件 - 请参阅 https://github.com/palantir/tslint/issues/2099.