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.
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: Introduce a way to suppress violations #119
feat: Introduce a way to suppress violations #119
Changes from 7 commits
a99c456
f9b3976
c9a718c
4d73750
9e035f1
ed01be1
d5411af
98779dc
b343ddb
ad5343d
485f684
70a7c56
4462ce6
1a1cbba
71ee661
2d4dc84
dc2d940
b8a1cf7
0c3d9a4
4fea00e
42d8b95
bff622d
48e9d0a
46cf6ae
a94a50d
861f1a4
566e3b9
78d37ab
b33e324
c005f3b
f134daa
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
By resolved you mean reported? If an error that is not filtered out by the baseline is reported, I assume that ESLint will display the error message and exit with an error code as usual. It is not clear to me why that would go unnoticed.
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.
@fasttime By resolved I am referring to a newly addressed violation. I have added a scenario as an example.
The purpose of this section, is to encourage developers re-generating the baseline after addressing one or more violations.
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.
Okay, thanks. Actually we don't know which errors are resolved. We can only compare the number of errors before and after the current run. If an edit fixes some errors for a rule but introduces some errors for another rule, re-generating the baseline would cause the newly introduced errors to be ignored in subsequent runs. I'm not sure that makes sense.
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.
You are right. This assumes there is an additional control of the baseline, through PRs as an example.
There is a suggestion to change the approach to be more close to what
eslint-bulk
provides. In that case, a new option will be introduced called--prune-suprressions
as briefly described here which I believe covers this gap.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.
the alternative we've introduced at Canva is that we designate specific rules as "in migration" and we only consider reports from those rules if they exist in changed files (according to
git
comparison against the main branch).With this system developers must address lint errors if they touch a file but otherwise they can be ignored.
This does require integration with the relevant source control system - though we've found it works quite well.