rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
5.72k stars 271 forks source link

Refactor `Function` type usage #5544

Open rak-phillip opened 10 months ago

rak-phillip commented 10 months ago
Don't use `Function` as a type. The `Function` type accepts any function-like value.
It provides no type safety when calling the function, which can be a common source of bugs.
It also accepts things like class declarations, which will throw at runtime as they will not be called with `new`.
If you are expecting the function to accept certain arguments, you should explicitly define the function shape.eslint[@typescript-eslint/ban-types](https://typescript-eslint.io/rules/ban-types)
interface Function

Files that need to be fixed

Please add a comment on why (I assume it's the Function?)

_Originally posted by @mook-as in https://github.com/rancher-sandbox/rancher-desktop/pull/5287#discussion_r1328987446_

jandubois commented 7 months ago

@mook-as Can this be closed? Should it be deferred?

mook-as commented 7 months ago

There's still usages (and code comments referencing this issue); in general we need a cleanup round to get rid of the vestiges of the nuxt removal, but there isn't a specific time frame for it as far as I know.