danday74
danday74

Reputation: 57185

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

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

Upvotes: 8

Views: 3272

Answers (1)

Subham Saha
Subham Saha

Reputation: 212

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

Upvotes: 12

Related Questions