elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.71k stars 8.13k forks source link

[Security Solution] Linting: add checks for unhandled promises #118349

Open banderror opened 2 years ago

banderror commented 2 years ago

Summary

In order to be able to catch bugs in the code like this one https://github.com/elastic/kibana/pull/118171, is it possible to check for unhandled promises via a linter rule or any other way?

elasticmachine commented 2 years ago

Pinging @elastic/security-detections-response (Team:Detections and Resp)

elasticmachine commented 2 years ago

Pinging @elastic/security-solution (Team: SecuritySolution)

spong commented 2 years ago

There were recent efforts to try and add @typescript-eslint/no-floating-promises but it was ultimately removed from the final PR.

Looks like the plan is to get it added and then enable plugin-by-plugin:

I'm not planning on forcing plugins to enable it as of right now, but I think it's a reasonable initiative if folks think it's a good idea. The plan is for plugins to opt-into for now.