angular cli lint error export on a different file

3.8k views Asked by At

I am using angular cli for my angular2 project. While I am using lint command for linting-and-formatting-code as follows

ng lint

I am able to see several errors on my command prompt as follows

src/app/quote/your-cart/your-cart.component.ts[118, 9]: missing whitespace
src/app/quote/your-cart/your-cart.component.ts[129, 8]: missing whitespace
src/app/quote/your-cart/your-cart.component.ts[130, 9]: missing whitespace
src/app/quote/your-cart/your-cart.component.ts[142, 21]: missing whitespace

Since it is reporting a huge list of errors, I want to export that error on some file. It could be HTML, TXT, or Even JSON is also fine.

In a nutshell I want to export angular cli lint error to some file.

Please help.

2

There are 2 answers

0
Mauricio Poppe On BEST ANSWER

ng lint prints to stdout so execute:

ng lint > out.txt

Works on both *nix and Windows

0
nimish kumar On

ng lint | findstr "name.module.ts"
ng lint | grep "name.module.ts" in git bash