How can I run ng lint
without showing warnings? TSLint CLI provides a --quiet flag, but there doesn't appear to be one for Angular or a way to pass through CLI flags. I still want warnings in my tsconfig so they show up in the editor, but sometimes I only want a list of errors.
"ng lint" quiet option?
Asked Answered
Just run ng lint --quiet
and only 'error' messages will be shown.
this is/should be the solution. –
Lickspittle
Widnows solution:
You can use findstr which Searches for patterns of text. The parameter /v
prints only lines that don't contain a match.
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/findstr
ng lint [PROJECT NAME] | findstr /v "WARNING: .*"
You can omit [Project Name] if you want to run everything in the directory
ng lint | findstr /v "WARNING: .*"
I'm not sure this is what you are asking, but if you add this line:
"defaultSeverity": "warning",
To your tslint.json
file, you will get warnings instead of errors when you run ng lint
.
My tslint.json
file looks like this:
{
"defaultSeverity": "warning",
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
...
I think he wants to only show the errors and suppress the warnings. –
Polypropylene
Correct, I want warnings and errors to both appear in intellisense, but when I run the
ng lint
command, I would like for it to run only reporting the errors. –
Manger Also looking for answer –
Weinberg
© 2022 - 2024 — McMap. All rights reserved.