-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fix emit warning error quiet #46
Fix emit warning error quiet #46
Conversation
ea689ee
to
45ede2e
Compare
Codecov Report
@@ Coverage Diff @@
## master #46 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 8
Lines 240 249 +9
Branches 66 69 +3
=========================================
+ Hits 240 249 +9
Continue to review full report at Codecov.
|
I have actually signed the CLA. I'm not really sure why it's not recognizing that though. |
@michaelangeliu First commits from unknown user (look at them, they are not have avatar) |
69858fb
to
d64f75d
Compare
- https://eslint.org/docs/user-guide/formatters/#eslint-formatters - This provides a single file with a variety of errors and warnings
- when linting a file that has both warnings and errors, if the quiet flag is set, then the errors should be emited, but the warnings should not
- replace force-emit-error and force-emit-warning tests with more robust tests that match the functionality of eslint-loader - if emitError is undefined or true, it should emit errors, otherwise if emitError is false, it should suppress errors - if emitWarning is undefined or true, it should emit warnings, otherwise if emitWarning is false, it should suppress warnings
- print errors only when emitError is undefined or true, otherwise suppress errors - print warnings only when emitWarning is undefined or true, otherwise suppress warnings - this allows the config to be set up to lint a file that has both warnings and errors and only show the relevant errors or warnings fix webpack-contrib#19 BREAKING CHANGE: Updates to emitError and emitWarning Setting only emitError to true will no longer exclusively print files with errors and disregard the files with warnings. Similarly, setting only emitWarning to true will no longer exclusively print files with warnings disregard the files with errors.
- quiet is essentially syntactic sugar for setting emitError to true and emitWarning to false fix webpack-contrib#19
d64f75d
to
ec0d635
Compare
@alexander-akait Thank you! I think I fixed it. |
This PR contains a:
Motivation / Use-Case
There are technically three different states for the flags emitError and emitWarning.
The flags can be undefined, true, or false. In the eslint-loader plugin, when the flag
is set to false, it suppresses the errors or warnings, allowing for the respective
alternative to be more visible. A popular use case would be if a file has both errors
and warnings, if emitWarning were set to false, it should only show the errors in the
file
#19
Breaking Changes
POTENTIAL BREAKING CHANGE: Updates to emitError and emitWarning
Setting only emitError to true will no longer exclusively print files with errors
and disregard the files with warnings. Similarly, setting only emitWarning to true
will no longer exclusively print files with warnings disregard the files with errors.
Additional Info
fix #19