TypeScript Analyzer (ESLint, Prettier)

A linter and formatter for JavaScript and TypeScript in Visual Studio

Rules For Finding tsconfig.json Files

The rules around how the TypeScript Analyzer finds tsconfig.json files if TypeScript: lint with tsconfig.json is set to True are a little complicated. For completeness full details are below.

Linting Individual .ts or .tsx Files

Linting Groups of Files

Linting Multiple Selections in Solution Explorer

Identifying tsconfig.json Files

It’s clearly possible in some of the scenarios above that one TypeScript file might be included in more than one tsconfig.json passed to ESLint. If there are any exact duplicate errors in the results then only one copy of the error is shown in the Visual Studio Error List. Otherwise all errors are shown.

In all cases a tsconfig.json file will only be handed to ESLint if it is in a Visual Studio project. However, individual files do not have to be included in a Visual Studio project to be linted if the TypeScript Analyzer is set to use tsconfig.json files.