Is it possible to have Webstorm consistently report all TypeScript errors across an entire project without having to open each individual file? I prefer using the language service for performance reasons rather than running tsc as a task.
I've noticed that Webstorm displays all issues in Dart projects by utilizing the Dart analysis server, which is similar to the Typescript language service. Essentially, I am seeking a way to configure Webstorm (or vscode) to function in the same manner for TypeScript as it does for Dart projects when it comes to identifying project-wide errors.
Update 2016-09-09:
Here's a quick example using Webstorm:
- Create a new project: File > New Project > Empty project
- Configure Webstorm settings: Preferences > Languages & Frameworks > TypeScript
- Enable TypeScript Service (experimental)
- Activate TypeScript Compiler
- Enable Track Changes
- Set Scope to Project Files
- Choose Set Options Manually
- Add command line options: --noEmit
Add these files to the project:
test1.ts
export const foo:number = 5;
test2.ts
import {foo} from './test1';
const bar:string = foo;
- Close all documents and exit Webstorm.
- Reopen Webstorm.
- Open the file test1.ts.
- Check "Current Errors" and "Project Errors" panes, they are both empty.
- Click on the "Compile all" button.
- Current Errors: empty (why?)
- Project Errors: test2.ts > Error:(3, 7) TS2322: Type 'number' is not assignable to type 'string'.
Now update the content of test1.ts to the following:
export const foo:string = "";
Save test1.ts.
- Both "Current Errors" and "Project Errors" remain the same as before.
- In this scenario, I would expect the panes to be cleared since the error in test2.ts has been resolved. However, because test2.ts is not currently opened in the editor, it does not seem to refresh.
- Click on the compile all button.
- Now both "Current Errors" and "Project Errors" are reset.