"ng lint" quiet option?
Asked Answered
M

3

12

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.

Manger answered 22/1, 2019 at 21:37 Comment(0)
R
14

Just run ng lint --quiet and only 'error' messages will be shown.

Rentier answered 17/10, 2022 at 14:7 Comment(1)
this is/should be the solution.Lickspittle
I
3

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: .*"
Isborne answered 20/9, 2019 at 14:45 Comment(0)
H
0

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": {
    ...
Hedge answered 22/1, 2019 at 22:18 Comment(3)
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 answerWeinberg

© 2022 - 2024 — McMap. All rights reserved.