-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(lint): add max-warnings for cli-plugin-eslint, close #1268 #1289
Conversation
The action on the status code is missing I think. The goal is to make the CLI exit with status >0 when the number of warings is greater than the parameter. |
Sorry but I didn't get your point...what is your expected behavior...😂
Yes, it is now. |
@@ -19,7 +20,7 @@ module.exports = function lint (args = {}, api) { | |||
CLIEngine.outputFixes(report) | |||
} | |||
|
|||
if (!report.errorCount) { | |||
if (report.errorCount <= (argsConfig.maxWarnings || 0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does report.errorCount
includes warnings ?
The expected behaviour is :
Examples:
|
@BenoitAverty In eslint cli, But in current So I think count both warnings and errors in |
This should do the trick :) Thanks for this. |
add a
--max-warnings
and--max-errors
option for cli-plugin-eslint to specify number of warnings or errors to trigger build failed.usage:
#1268
https://eslint.org/docs/user-guide/command-line-interface#options