Skip to content
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

Chore: use precalculated counts in stylish formatter #8251

Merged
merged 1 commit into from
Mar 17, 2017
Merged

Conversation

alberto
Copy link
Member

@alberto alberto commented Mar 14, 2017

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[X] Other, please explain:

What changes did you make? (Give an overview)
Use the precalculated error and warning count in stylish

Is there anything you'd like reviewers to focus on?
Is there a reason why we weren't doing this before?

@mention-bot
Copy link

@alberto, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mgol, @sindresorhus and @mysticatea to be potential reviewers.

@eslintbot
Copy link

LGTM

@@ -74,6 +74,8 @@ module.exports = function(results) {
).split("\n").map(el => el.replace(/(\d+)\s+(\d+)/, (m, p1, p2) => chalk.dim(`${p1}:${p2}`))).join("\n")}\n\n`;
});

total = errors + warnings;
Copy link
Member

@not-an-aardvark not-an-aardvark Mar 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could total be declared with const instead of let?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, sure!

@eslintbot
Copy link

LGTM

Copy link
Member

@vitorbal vitorbal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. FWIW, the codeframe formatter could also be updated to use the precalculated counts: https://github.com/eslint/eslint/blob/master/lib/formatters/codeframe.js#L105-L109

@not-an-aardvark not-an-aardvark added the chore This change is not user-facing label Mar 15, 2017
@alberto alberto merged commit 63ca0c5 into master Mar 17, 2017
@alberto alberto deleted the stylish-cleanup branch March 17, 2017 00:33
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants