Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show project wide TypeScript problems/errors in webstorm

Is there any way to make Webstorm continuously report all typescript errors project wide without opening all the files? For performance reasons I would like it done using the language service and not by a task running tsc.

I know Webstorm shows all problems in Dart projects using the Dart analysis server which I think is similar to the Typescript language service. So basically I am looking for a way to make Webstorm (or vscode) work the same way for TypeScript as it does for Dart projects with regards to reporting project wide errors.

Edit 2016-09-09:

A small example in Webstorm:

  • File > New Project > Empty project
  • Configure Webstorm > Preferences > Languages & Frameworks > TypeScript
  • Check Use TypeScript Service (experimental)
  • Check Enable TypeScript Compiler
  • Check Track Changes
  • Scope: Project Files
  • Select Set Options Manually
  • Command line options: --noEmit

Add these files:

test1.ts

export const foo:number = 5;

test2.ts

import {foo} from './test1';
const bar:string = foo;
  • Close all documents and quit Webstorm.
  • Restart Webstorm.
  • Open the file test1.ts.
  • Check "Current Errors" and "Project Errors" panes, they are both blank.
  • Press "Compile all" button.
  • Current Errors: blank (why?)
  • Project Errors: test2.ts > Error:(3, 7) TS2322: Type 'number' is not assignable to type 'string'.

Now change the contents of test1.ts to this:

export const foo:string = "";

Save test1.ts.

  • Both "Current Errors" and "Project Errors" are the same as before.
  • Here I would expect the panes to be cleared since the error in test2.ts is fixed, but since test2.ts is not open in the editor it does not seem to update.
  • Press compile all button.
  • Now both "Current Errors" and "Project Errors" are cleared.
like image 834
Jonas Kello Avatar asked May 28 '26 05:05

Jonas Kello


1 Answers

On Webstorm, the Typescript -> Current Errors tab displays project wide errors 'live'

Introduce or fix an error and the result will appear in that tab.

Typescript preferences must correctly be set; WS is using the project tsconfig.json in the example below. A 'Compile All' must be run from that tab at least once (to build the errors cache, I guess)

enter image description here

like image 99
Bruno Grieder Avatar answered May 31 '26 23:05

Bruno Grieder