简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM