I'm attempting to use the linter that comes with Angular 8, but I've neglected TSLint errors for a while. I'm hoping to slowly clean up the errors, and I'm searching for a way to run the linter on entire directories, some of which may have multiple subdirectories.
I've looked at the Angular documentation for ng lint, but I'm not finding anything helpful (or I may be overlooking something). What I thought I was looking for was the --files flag, but I must be doing something wrong, because when I run ng lint --files, I can only get it to work with a single file, and not an entire directory.
For example, using ng lint --files src/app/+register/registration.component.ts works perfectly.
Does anybody have any thoughts on this? I'd love some help.
Thanks in advance!
For those like me who visit this question some years later with a newer Angular version:
ng lint --lint-file-patterns=src/app/your/path/**/*.ts
tested on Angular 14
You can use a glob, or wildcard, to get the functionality you need. Example below.
ng lint --files=src/app/folder/**/*.ts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With