ng lint how to use eslint CLI flags such as --max-warnings=0

Viewed 1171

I've got an Angular 10 project that uses eslint.

I run my linting with:

ng lint

There are no errors but some warnings. I want ng lint to fail with a non zero exit code when there are only warnings. I've tried using the eslint flag --max-warnings=0 as follows:

ng lint --max-warnings=0

but it says:

unknown option '--max-warnings'

This SO post suggests --max-warnings is an eslint CLI option only and cannot be configured via an .eslintrc file

How can I force linting to fail when there are only warnings when running ng lint? Many thanks

1 Answers

--max-warnings 0 try this. The = is not required.

Related