Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable ESLint for TypeScript files in Visual Studio 2019?

I have ESLint enabled in the Tools/Options under Text Editor/Javascript/TypeScript/Linting/General:

enter image description here

but I don't see any evidence that it's actually working. I tried writing code that triggers ESLint in VS Code, but nothing is happening in Visual Studio 2019. For reference, it's a .NET Core Web Project.

What am I missing?

P.S. Not sure if VS 2019 uses, but I do have ESLint installed (via NPM) and working in Visual Code.

like image 255
AngryHacker Avatar asked Sep 13 '19 00:09

AngryHacker


People also ask

Can I use ESLint with TypeScript?

ESLint is a JavaScript linter that you can use to lint either TypeScript or JavaScript code.

Do you need ESLint for TypeScript?

In the TypeScript 2019 Roadmap, the TypeScript core team explains that ESLint has a more performant architecture than TSLint and that they will only be focusing on ESLint when providing editor linting integration for TypeScript. For that reason, I would recommend using ESLint for linting TypeScript projects.


1 Answers

Visual Studio didn't support Typescript at the time this question was asked. For anyone viewing the question now, as of VS 2019 version 16.5, it finally supports Typescript:

https://github.com/microsoft/JSTSdocs/blob/master/articles/editor/linting.md

like image 146
k29 Avatar answered Sep 28 '22 15:09

k29