[英]ng lint how to use eslint CLI flags such as --max-warnings=0
I've got an Angular 10 project that uses eslint.我有一个使用 eslint 的 Angular 10 项目。
I run my linting with:我运行我的 linting:
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.当只有警告时,我希望
ng lint
以非零退出代码失败。 I've tried using the eslint flag --max-warnings=0 as follows:我尝试使用 eslint 标志 --max-warnings=0 如下:
ng lint --max-warnings=0
but it says:但它说:
unknown option '--max-warnings'
未知选项'--max-warnings'
This SO post suggests --max-warnings is an eslint CLI option only and cannot be configured via an.eslintrc file这个 SO post建议 --max-warnings 只是一个 eslint CLI 选项,不能通过 an.eslintrc 文件配置
How can I force linting to fail when there are only warnings when running ng lint
?当运行
ng lint
时只有警告时,如何强制 linting 失败? Many thanks非常感谢
--max-warnings 0
try this. --max-warnings 0
试试这个。 The =
is not required. =
不是必需的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.