-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Change Request: Add api support for timing information #16521
Comments
Since we already allow this for CLI, I feel it makes sense to support this with Nodejs API. I'd like to know what other team members think about this. |
👍 If we have the data, we can expose it. The question is: what is the best way to expose it? We can't just add a method to This would require an RFC. |
Interested in this feature. |
Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update. |
Please don't auto-close this issue, as this is still needed! :) |
I was imagining all sorts of additional statistics we could calculate about rules (violations, suppressions, time, etc) in: #14597 (comment). It would be ideal if this information was available via both CLI and Node API. So it could be worthwhile to account for additional "summary" metrics in any new API. |
Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update. |
Again, Please don't auto-close this issue, as this is still needed! :) |
@Mattstir best way to make sure this doesn't get closed is to open an RFC. The core team won't be working on this, so unless someone from the community chips in, this won't get done. |
Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update. |
RFC is opened, so definitely not stale. |
Not stale. Waiting for eslint/rfcs#108. |
The RFC has been accepted, it is being implemented in #17850. |
#17850 has been merged, so closing. |
ESLint version
8.22.0
What problem do you want to solve?
Currently it is not possible to get the TimingInformation, when using the Node.js API.
Only CLI supports the output of the TIMING information. Adding this also for the nodejs api would allow for automatic reporting of slow rules. In a big project with a lot of rules (also a lot of custom - quite heavy ones) this would come in quite handy.
What do you think is the correct solution?
My take on this would be to add a new option to the
ESLint.Options
.e.g.:
timing: true
To not break any current usages, changing the report value of e.g.: lintFiles isn't really possible.
Therefore adding a function that allows to get the timing information of the last lintrun would make sense.
e.g.:
eslint.getLatestTimingInformation
This returns an array with a following object per rule:
Participation
Additional comments
No response
The text was updated successfully, but these errors were encountered: