Fix emit warning error quiet - #46
Merged
ricardogobbosouza merged 5 commits intoJan 25, 2021
Merged
ricardogobbosouza merged 5 commits into
ricardogobbosouza merged 5 commits into
Conversation
michaelangeliu
force-pushed
the
fix-emit-warning-error-quiet
branch
from
November 18, 2020 08:41
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.
|
ricardogobbosouza
previously approved these changes
Jan 21, 2021
Contributor
Author
|
I have actually signed the CLA. I'm not really sure why it's not recognizing that though. |
Member
|
@michaelangeliu First commits from unknown user (look at them, they are not have avatar) |
michaelangeliu
force-pushed
the
fix-emit-warning-error-quiet
branch
from
January 23, 2021 06:02
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#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#19
michaelangeliu
force-pushed
the
fix-emit-warning-error-quiet
branch
from
January 23, 2021 06:40
d64f75d to
ec0d635
Compare
Contributor
Author
|
@alexander-akait Thank you! I think I fixed it. |
alexander-akait
approved these changes
Jan 25, 2021
2 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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