最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

VSCode's "TypeScript and JavaScript Language Features" duplicates warnings when ESLint is enabled, but

programmeradmin3浏览0评论

Trying to get basic ESLint working in a non-TypeScript repository, but VSCode won't stop showing me warnings from "ts" despite not having TypeScript anywhere in my project. After some experimenting I realized that these warnings come from the built-in "TypeScript and JavaScript Language Features" extension, and disabling that extension gets rid of them. However, these warnings only pop up when I have the ESLint extension enabled. If I disable the ESLint extension, the warnings go away.

This creates a situation where I either have to see duplicated warnings (one from eslint and another from ts) or no warnings at all.

For example, declaring a variable and then never using it generates these two warnings:

'myVariable' is declared but its value is never read. ts(6133)
'myVariable' is defined but never used. eslint(no-unused-vars)

How can I stop VSCode from automatically giving me these warnings? If I was using TypeScript in my project I could turn these off in tsconfig.json, but I'm not even using TypeScript so I'm unsure of how to approach this. I'd like to use ESLint instead of VSCode's default, non-configurable IntelliSense. I found two other threads asking about this on StackOverflow but none of the answers worked for me.

Also curious: Why does VSCode only show the warnings from "ts" when I have the ESLint extension enabled? I don't see why those two things would be related.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论