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: Rule Performance Statistics for flat ESLint #17850
Conversation
✅ Deploy Preview for docs-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Just converting this to a draft so we know it's not yet time to review it. |
@me4502 getting back around to this now. Can you please rebase on top of main? And if you feel you're ready for review now, please feel free to hit that button. :) |
Great to hear! I just did a rebase, so the implementation should be up to date with the new ESLint now. All that is left is to add tests for it, but I suppose those would come in a second review round? So, pressing the Ready for Review button now 👍 |
Go ahead and add the tests now. We like to review the code and the tests together as oftentimes the tests tell more of the story than the code does. |
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.
This is looking good. I'd just like to avoid passing stats
around in so many places. (I left a comment inline about this, as well.) If we can instead pull that parts out of slots
and later assign them back, we can make the additional functionality more testable.
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 refactoring around slots
looks good to me. Left a couple of suggestions for areas to clean up, but this is looking really good.
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.
LGTM, thanks! Would like @mdjermanovic to review before merging.
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.
Latest changes LGTM. Waiting for @mdjermanovic to re-review.
@nzakas: Any updates on this? 😇 |
@mnkiefer sorry for the delay, I'll review it soon. |
Totals for rules should be the same as with For example: // eslint.config.js
module.exports = [{
languageOptions: {
sourceType: "commonjs"
},
linterOptions: {
reportUnusedDisableDirectives: "off"
},
rules: {
indent: ["error", 4, { SwitchCase: 1 }]
}
}];
Per the stats, |
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
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.
LGTM, thanks! Leaving open for @nzakas to verify again as this has had a lot of changes since the last approval.
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.
Just left a few notes of things to clean up before merging.
Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
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.
LGTM. Once again, thank you for your hard work on such a detailed feature. We really appreciate it. 🙏
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[X] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
--stats
to flat ESLint, which enables the user to obtain a series of runtime statistics on top of their final lint results (refer to the table below).Is there anything you'd like reviewers to focus on?